From 80eebbc73c4a810709092f5e98efc66e950fc261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Cabrera?= Date: Mon, 17 Jun 2024 13:30:05 -0400 Subject: [PATCH] Statically link to the C runtime in MSVC Javy version 1.4.0 statically linked to the C runtime. Such version was built with Rust 1.75. Javy version 2.0.0, built with Rust 1.79.0, which doesn't perform static linking by default. This commit adds a directive to preserve the same behavior as in v 1.4.0. --- .cargo/config.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index 2bcccfe9..949ef543 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -4,3 +4,9 @@ # https://doc.rust-lang.org/cargo/reference/config.html [target.wasm32-wasi] rustflags = ["-C", "target-feature=+simd128"] + +# We want to ensure that all the MSVC dependencies are statically resolved and +# included in the final CLI binary. +# Ref: https://github.com/rust-lang/rust/pull/122268 +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"]