From 1f65fd2bb714286fd2bcbd5fa2398ceea3733b47 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Wed, 4 Dec 2024 19:32:09 +0100 Subject: [PATCH] fix(cli): Statically compile msvc runtime (#11769) * fix(cli): Statically compile msvc runtime fixes https://github.com/tauri-apps/tauri/issues/11642 ref https://github.com/swc-project/swc/pull/7965 i only added it for x64 for now but we should monitor x32 (swc removed it for this one again) and aarch64 (swc never added it). x32 is fairly rare as a dev system and aarch64 didn't seem much testing in general (as a dev system) so i'd prefer to wait and see if it's needed. note that i don't know if any other tooling (rust etc) need the dyn runtime so that's also something to monitor * 32bit and arm64 --- packages/cli/.cargo/config.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/cli/.cargo/config.toml b/packages/cli/.cargo/config.toml index 89c63d2c5..28b5f661b 100644 --- a/packages/cli/.cargo/config.toml +++ b/packages/cli/.cargo/config.toml @@ -7,3 +7,10 @@ rustflags = ["-C", "target-feature=-crt-static"] [target.armv7-unknown-linux-gnueabihf] linker = "arm-linux-gnueabihf-gcc" + +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] +[target.i686-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] +[target.aarch64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"]