Skip to content

Commit

Permalink
windows: static link vcruntime140.dll
Browse files Browse the repository at this point in the history
  • Loading branch information
liias committed Dec 29, 2023
1 parent 1b36abf commit 193e645
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
#target = "aarch64-pc-windows-msvc"
#target = "aarch64-unknown-linux-gnu"
#target = "aarch64-apple-darwin"

[target.'cfg(all(windows, target_env = "msvc"))']
rustflags = ["-C", "target-feature=+crt-static"]
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ dunce = "1.0.4"
# Requires rc.exe from the Windows SDK (or windres.exe and ar.exe from minGW64)
winres = "0.1.12"

# statically link vcruntime140.dll instead of requiring user to install the runtime
static_vcruntime = "2.0"

#[profile.dev]
#lto = true

Expand Down
3 changes: 3 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ fn main() {
let mut res = winres::WindowsResource::new();
res.set_icon("extra/windows/icons/browsers.ico");
res.compile().unwrap();

// statically link vcruntime140.dll instead of requiring user to install the runtime
static_vcruntime::metabuild();
}

#[cfg(target_os = "linux")]
Expand Down

0 comments on commit 193e645

Please sign in to comment.