From 1247f2b9f87ec6c4c469fc95b4a925e4e8ec63eb Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Thu, 17 Oct 2024 03:22:16 +0800 Subject: [PATCH] framework_tool: Statically link CRT Otherwise it won't run on freshly installed Windows systems because vcruntime is missing. Must `cargo build --release` to get it. Debug builds won't have it linked statically. Signed-off-by: Daniel Schaefer --- Cargo.lock | 7 +++++++ framework_tool/Cargo.toml | 3 +++ framework_tool/build.rs | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 framework_tool/build.rs diff --git a/Cargo.lock b/Cargo.lock index 900f227..5176ed0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -354,6 +354,7 @@ name = "framework_tool" version = "0.1.0" dependencies = [ "framework_lib", + "static_vcruntime", ] [[package]] @@ -1115,6 +1116,12 @@ dependencies = [ "lock_api", ] +[[package]] +name = "static_vcruntime" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "954e3e877803def9dc46075bf4060147c55cd70db97873077232eae0269dc89b" + [[package]] name = "strsim" version = "0.10.0" diff --git a/framework_tool/Cargo.toml b/framework_tool/Cargo.toml index a689eba..7a9266d 100644 --- a/framework_tool/Cargo.toml +++ b/framework_tool/Cargo.toml @@ -12,3 +12,6 @@ windows = ["framework_lib/windows"] [dependencies.framework_lib] path = "../framework_lib" default-features = false + +[build-dependencies] +static_vcruntime = "2.0" diff --git a/framework_tool/build.rs b/framework_tool/build.rs new file mode 100644 index 0000000..20e1c8e --- /dev/null +++ b/framework_tool/build.rs @@ -0,0 +1,3 @@ +fn main() { + static_vcruntime::metabuild(); +}