Skip to content
Draft
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
20 changes: 20 additions & 0 deletions core/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
// SPDX-License-Identifier: MIT OR Apache-2.0

fn main() -> Result<(), Box<dyn std::error::Error>> {
if std::env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default() == "msvc" {
// Statically link VCRUNTIME140.dll when building for MSVC target
// because otherwise Sysand may segfault if the system has a conflicting
// version of VCRUNTIME140.dll.

// Do not link these versions of VCRUNTIME140.dll
println!("cargo:rustc-link-arg=/NODEFAULTLIB:libvcruntimed.lib");
println!("cargo:rustc-link-arg=/NODEFAULTLIB:vcruntime.lib");
println!("cargo:rustc-link-arg=/NODEFAULTLIB:vcruntimed.lib");
// Link this version of VCRUNTIME140.dll
println!("cargo:rustc-link-arg=/DEFAULTLIB:libvcruntime.lib");
return Ok(());
}

Ok(())
}
Loading