diff --git a/proj-sys/build.rs b/proj-sys/build.rs index 96c44945..76d61d24 100644 --- a/proj-sys/build.rs +++ b/proj-sys/build.rs @@ -121,6 +121,15 @@ fn build_from_source() -> Result> 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