diff --git a/.cargo/config b/.cargo/config index 7b655dc..ef0df66 100644 --- a/.cargo/config +++ b/.cargo/config @@ -4,8 +4,3 @@ #rustflags = ["-C", "link-arg=-fuse-ld=lld"] #[target.aarch64-unknown-linux-gnu] #rustflags = ["-C", "link-arg=-fuse-ld=lld"] - -# Statically link the MSVC C Runtime on Windows, so the EXEs can run without -# installing the C Runtime DLL. -#[target.'cfg(all(target_env = "msvc"))'] -#rustflags = ["-C", "target-feature=+crt-static"] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d215016..96d02ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -102,6 +102,17 @@ jobs: use-cross: false steps: + + # Build all crates with a statically linked MSVCRT. Specifically crates + # that use `cc` in their build scripts (like libgit2-sys), will detect this + # and compile objects appropriatly. If there is a way to put this into a + # Cargo config file some where, let me know. .cargo/config did not work. + - name: Statically link MSVCRT + shell: bash + if: matrix.os == 'windows' + run: | + echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV + - name: Checkout repository uses: actions/checkout@v2