diff --git a/.changes/static-vcruntime-envvar.md b/.changes/static-vcruntime-envvar.md new file mode 100644 index 000000000..99702262e --- /dev/null +++ b/.changes/static-vcruntime-envvar.md @@ -0,0 +1,6 @@ +--- +"cli.rs": patch +"cli.js": patch +--- + +Skip the static link of the `vcruntime140.dll` if the `STATIC_VCRUNTIME` environment variable is set to `false`. diff --git a/tooling/cli/src/interface/rust.rs b/tooling/cli/src/interface/rust.rs index 1191c34b6..cc03246eb 100644 --- a/tooling/cli/src/interface/rust.rs +++ b/tooling/cli/src/interface/rust.rs @@ -155,7 +155,10 @@ impl Interface for Rust { .features .get_or_insert(Vec::new()) .push("custom-protocol".into()); - std::env::set_var("STATIC_VCRUNTIME", "true"); + + if !std::env::var("STATIC_VCRUNTIME").map_or(false, |v| v == "false") { + std::env::set_var("STATIC_VCRUNTIME", "true"); + } if options.target == Some("universal-apple-darwin".into()) { std::fs::create_dir_all(&out_dir)