Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crates/occt-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ pub fn occt_path() -> PathBuf {

/// Build the OCCT library.
pub fn build_occt() {
// Get the Cargo profile and map it to CMake build type
let profile = var("PROFILE").unwrap_or_else(|_| "debug".to_string());
let cmake_profile = if profile == "release" { "Release" } else { "Debug" };

cmake::Config::new(Path::new(env!("OCCT_SRC_DIR")))
.define("BUILD_PATCH", Path::new(env!("OCCT_PATCH_DIR")))
.define("BUILD_LIBRARY_TYPE", "Static")
Expand All @@ -40,7 +44,7 @@ pub fn build_occt() {
.define("USE_XLIB", "FALSE")
.define("INSTALL_DIR_LIB", LIB_DIR)
.define("INSTALL_DIR_INCLUDE", INCLUDE_DIR)
.profile("Release")
.profile(cmake_profile)
.out_dir(occt_path())
.build();
}
4 changes: 4 additions & 0 deletions crates/opencascade-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ fn main() {

if is_windows {
println!("cargo:rustc-link-lib=dylib=user32");
println!("cargo:rustc-link-lib=dylib=advapi32");
println!("cargo:rustc-link-lib=dylib=gdi32");
println!("cargo:rustc-link-lib=dylib=shell32");
println!("cargo:rustc-link-lib=dylib=comdlg32");
}

let mut build = cxx_build::bridge("src/lib.rs");
Expand Down