Skip to content

Commit

Permalink
Attempt to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
crumblingstatue committed Oct 12, 2024
1 parent a81df8d commit 1db5bf5
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ fn main() {
let feat_audio = env::var("CARGO_FEATURE_AUDIO").is_ok();
let feat_window = env::var("CARGO_FEATURE_WINDOW").is_ok();
let feat_graphics = env::var("CARGO_FEATURE_GRAPHICS").is_ok();
let libflac_root = env::var("DEP_FLAC_ROOT").unwrap();
let mut cmake = cmake::Config::new("SFML");
let win_env = WinEnv::get();
let release_profile = env::var("PROFILE").is_ok_and(|prof| prof == "release");
Expand Down Expand Up @@ -142,11 +141,22 @@ fn main() {
}
_ => ("/lib", "/build/src/libFLAC"),
};
cmake.define(
"CMAKE_PREFIX_PATH",
// We add both the path to libogg and libFLAC. Two separate paths, separated by `;`.
[&libflac_root, libogg_loc, ";", &libflac_root, libflac_loc].concat(),
);
match env::var("DEP_FLAC_ROOT") {
Ok(libflac_root) => {
cmake.define(
"CMAKE_PREFIX_PATH",
// We add both the path to libogg and libFLAC. Two separate paths, separated by `;`.
[&libflac_root, libogg_loc, ";", &libflac_root, libflac_loc].concat(),
);
}
Err(e) => {
println!(
"cargo:warning=Failed to get DEP_FLAC_ROOT: {e}.\n\
Now the build will horribly break.\n\
Except maybe on CI. ;)"
);
}
}
}
if !feat_window {
cmake.define("SFML_BUILD_WINDOW", "FALSE");
Expand Down

0 comments on commit 1db5bf5

Please sign in to comment.