diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 00000000..68e5fdb2 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,6 @@ +# On Windows MSVC, statically link the C runtime so that the resulting EXE does +# not depend on the vcruntime DLL. +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] +[target.i686-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07194cc6..61e5b0a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,12 +61,16 @@ jobs: vcpkgGitCommitId: '163fe7bd3d67c41200617caaa245b5ba2ba854e6' runVcpkgInstall: true + - name: Export VCPKGRS_TRIPLET env var + shell: bash + run: echo "VCPKGRS_TRIPLET=${{ matrix.vcpkg_triplet }}" >> $GITHUB_ENV + + - run: cargo test --target=${{matrix.target}} + - uses: dtolnay/rust-toolchain@stable with: target: ${{matrix.target}} - - run: cargo test --target=${{matrix.target}} - - name: Test build with Openssl # Ideally, we should run the tests as well. At the moment, this # does not work as the vcpkg installation does not seem to be very well handled with @@ -79,10 +83,10 @@ jobs: build: [windows, windows32] include: - build: windows - vcpkg_triplet: x64-windows-static-md + vcpkg_triplet: x64-windows-static target: x86_64-pc-windows-msvc - build: windows32 - vcpkg_triplet: x86-windows-static-md + vcpkg_triplet: x86-windows-static target: i686-pc-windows-msvc clippy: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 423724fc..8273c1a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,11 +52,11 @@ jobs: - build: win-msvc os: windows-2022 target: x86_64-pc-windows-msvc - vcpkg_triplet: x64-windows-static-md + vcpkg_triplet: x64-windows-static - build: win32-msvc os: windows-2022 target: i686-pc-windows-msvc - vcpkg_triplet: x86-windows-static-md + vcpkg_triplet: x86-windows-static steps: - name: Checkout repository @@ -83,6 +83,11 @@ jobs: vcpkgGitCommitId: '163fe7bd3d67c41200617caaa245b5ba2ba854e6' runVcpkgInstall: true + - name: Export VCPKGRS_TRIPLET env var + if: ${{ matrix.os == 'windows-2022' }} + shell: bash + run: echo "VCPKGRS_TRIPLET=${{ matrix.vcpkg_triplet }}" >> $GITHUB_ENV + - name: Install Rust uses: dtolnay/rust-toolchain@stable with: