Update project structure and configurations
This commit is contained in:
@@ -32,23 +32,27 @@ fn main() {
|
||||
if let Some(coolprop_path) = coolprop_src_path() {
|
||||
println!("cargo:rerun-if-changed={}", coolprop_path.display());
|
||||
|
||||
// Build CoolProp using CMake
|
||||
let dst = cmake::Config::new(&coolprop_path)
|
||||
// Build CoolProp using CMake (always Release to match Rust's CRT)
|
||||
let mut config = cmake::Config::new(&coolprop_path);
|
||||
config
|
||||
.define("COOLPROP_SHARED_LIBRARY", "OFF")
|
||||
.define("COOLPROP_STATIC_LIBRARY", "ON")
|
||||
.define("COOLPROP_CATCH_TEST", "OFF")
|
||||
.define("COOLPROP_C_LIBRARY", "ON")
|
||||
.define("COOLPROP_MY_IFCO3_WRAPPER", "OFF")
|
||||
.build();
|
||||
.profile("Release");
|
||||
let dst = config.build();
|
||||
|
||||
println!("cargo:rustc-link-search=native={}/build", dst.display());
|
||||
println!("cargo:rustc-link-search=native={}/build/Debug", dst.display());
|
||||
println!("cargo:rustc-link-search=native={}/build/Release", dst.display());
|
||||
println!("cargo:rustc-link-search=native={}/lib", dst.display());
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}/build",
|
||||
coolprop_path.display()
|
||||
); // Fallback
|
||||
|
||||
// Link against CoolProp statically
|
||||
// Link against CoolProp statically (always Release build, no 'd' suffix)
|
||||
println!("cargo:rustc-link-lib=static=CoolProp");
|
||||
|
||||
// On macOS, force load the static library so its symbols are exported in the final cdylib
|
||||
|
||||
Reference in New Issue
Block a user