From 1861d05b6ee948cff64149352c31aa8a499394b2 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Wed, 28 Jun 2023 02:47:54 +0000 Subject: [PATCH] windows: Statically link vcruntime DLL Otherwise it won't run on some freshly installed machines. Windows complains that `vcruntime140.dll` is missing. Users would have to install the MSVC C++ Redistributable package. This is the same fix as in FrameworkComputer/qmk_hid. The measurements of that binary are: On a local build of `cargo clean; cargo build --release`: Size of .exe before: 857 KB Size of .exe after: 878 KB Note: Only affects release builds! I think that's because the debug version of this DLL isn't redistributable. Signed-off-by: Daniel Schaefer --- inputmodule-control/Cargo.toml | 3 +++ inputmodule-control/build.rs | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 inputmodule-control/build.rs diff --git a/inputmodule-control/Cargo.toml b/inputmodule-control/Cargo.toml index 276cb0d..3f5a216 100644 --- a/inputmodule-control/Cargo.toml +++ b/inputmodule-control/Cargo.toml @@ -20,3 +20,6 @@ rand = "0.8.5" vis-core = { git = 'https://github.com/Rahix/visualizer2.git', rev = '1fe908012a9c156695921f3b6bb47178e1332b92', optional = true } [features] audio-visualizations = ["vis-core"] + +[build-dependencies] +static_vcruntime = "2.0" diff --git a/inputmodule-control/build.rs b/inputmodule-control/build.rs new file mode 100644 index 0000000..20e1c8e --- /dev/null +++ b/inputmodule-control/build.rs @@ -0,0 +1,3 @@ +fn main() { + static_vcruntime::metabuild(); +}