From 919f1a650f822f61290c2c683d9329b8f692d94c Mon Sep 17 00:00:00 2001 From: AMS21 Date: Tue, 24 Oct 2023 10:00:03 +0200 Subject: [PATCH] Fix cmake build failure when using multi-config generators By also setting `CMAKE_CONFIGURATION_TYPES` to the required config the build no longer fails. --- sdl2-sys/build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdl2-sys/build.rs b/sdl2-sys/build.rs index 61e7f4aaea..46876b2656 100644 --- a/sdl2-sys/build.rs +++ b/sdl2-sys/build.rs @@ -96,8 +96,10 @@ fn compile_sdl2(sdl2_build_path: &Path, target_os: &str) -> PathBuf { let mut cfg = cmake::Config::new(sdl2_build_path); if let Ok(profile) = env::var("SDL2_BUILD_PROFILE") { cfg.profile(&profile); + cfg.define("CMAKE_CONFIGURATION_TYPES", &profile); } else { cfg.profile("Release"); + cfg.define("CMAKE_CONFIGURATION_TYPES", "Release"); } // Allow specifying custom toolchain specifically for SDL2.