Skip to content

Commit

Permalink
Fix cmake build failure when using multi-config generators
Browse files Browse the repository at this point in the history
By also setting `CMAKE_CONFIGURATION_TYPES` to the required config the
build no longer fails.
  • Loading branch information
AMS21 committed Oct 24, 2023
1 parent 76748c5 commit 919f1a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdl2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 919f1a6

Please sign in to comment.