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

This commit is contained in:
Lucas Fernandes Nogueira 2022-07-06 09:29:03 -03:00 committed by GitHub
parent 038c2cc8b1
commit 2e61abaa9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -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`.

View File

@ -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)