Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: do not link with windows CRT #2

Merged
merged 1 commit into from
Dec 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down