Bladeren bron

feat(cli): allow dynamic link vcruntime, closes #4565 (#4601)

Lucas Fernandes Nogueira 3 jaren geleden
bovenliggende
commit
2e61abaa9a
2 gewijzigde bestanden met toevoegingen van 10 en 1 verwijderingen
  1. 6 0
      .changes/static-vcruntime-envvar.md
  2. 4 1
      tooling/cli/src/interface/rust.rs

+ 6 - 0
.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`.

+ 4 - 1
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)