Skip to content

Commit

Permalink
Link vcruntime statically
Browse files Browse the repository at this point in the history
Fixes the program not starting on some Windows systems
  • Loading branch information
null-dev committed Feb 21, 2022
1 parent 490b031 commit d02fca1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
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.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ 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
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ 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 d02fca1

Please sign in to comment.