Skip to content

Commit

Permalink
Another attempt to link vcruntime statically
Browse files Browse the repository at this point in the history
  • Loading branch information
null-dev committed Feb 21, 2022
1 parent d02fca1 commit f2a2ff9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

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

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ url = "2.2.0"
chrono = "0.4"
rand = "0.8"
nng = "1.0.1"
static_vcruntime = "1.5"

[target.'cfg(target_family = "unix")'.dependencies]
nix = "0.19"
Expand Down Expand Up @@ -60,4 +59,11 @@ firefox_profile_switcher_connector = { path = "/usr/bin/ff-pswitch-connector" }
[package.metadata.rpm.files]
"../manifest/manifest-linux.json" = { path = "/usr/lib/mozilla/native-messaging-hosts/ax.nd.profile_switcher_ff.json" }

# Statically link C runtime, see: https://volks73.github.io/cargo-wix/cargo_wix/index.html#c-runtime
# We tried using https://github.com/ChrisDenton/static_vcruntime but it doesn't build
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
[target.i686-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

# TODO Strip once https://github.com/rust-lang/rust/issues/72110 is on stable
4 changes: 0 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ extern crate chrono;
extern crate rand;
extern crate serde_cbor;

// By default, Rust requires programs to deploy vcruntime140.dll when redistributing binaries on Windows.
// The static_vcruntime crate statically links the library instead.
extern crate static_vcruntime; // Required for static_vcruntime to work

use std::{io, env};
use std::fs;
use directories::ProjectDirs;
Expand Down

0 comments on commit f2a2ff9

Please sign in to comment.