Skip to content

Commit

Permalink
Add bundling support on windows (georust#192)
Browse files Browse the repository at this point in the history
We need to always build release builds there (to prevent linker errors
due to mixing up debug and release runtimes) and we need an additional
flag to prevent the static library to expect some proj.dll file to exist
  • Loading branch information
weiznich authored and urschrei committed Jul 1, 2024
1 parent cd16f24 commit 4c4846f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions proj-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ fn build_from_source() -> Result<std::path::PathBuf, Box<dyn std::error::Error>>
config.define("ENABLE_TIFF", "OFF");
}

if cfg!(target_env = "msvc") {
// rust links the release MVSC runtime
// also for debug builds. If we let
// cmake choose debug/release builds
// based on the underlying cargo build
// version that results in linker errors
config.profile("Release");
}

let proj = config.build();
// Tell cargo to tell rustc to link libproj, and where to find it
// libproj will be built in $OUT_DIR/lib
Expand Down

0 comments on commit 4c4846f

Please sign in to comment.