Skip to content

Commit 9c5b466

Browse files
authored
Merge pull request #13 from ZibanPirate/enforce-static-crt
Add flag for multi-threaded C++ build configuration
2 parents 5603b9c + 8a851ea commit 9c5b466

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

.github/workflows/cd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
SCCACHE_GHA_ENABLED: "true"
5656
# todo-zm: remove conditional once https://github.com/Mozilla-Actions/sccache-action/issues/189 is resolved
5757
RUSTC_WRAPPER: ${{ matrix.platform != 'windows-11-arm' && 'sccache' || '' }}
58+
RUSTFLAGS: -Ctarget-feature=+crt-static
5859

5960
steps:
6061
- uses: actions/checkout@v4

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
SCCACHE_GHA_ENABLED: "true"
2727
# todo-zm: remove conditional once https://github.com/Mozilla-Actions/sccache-action/issues/189 is resolved
2828
RUSTC_WRAPPER: ${{ matrix.platform != 'windows-11-arm' && 'sccache' || '' }}
29+
RUSTFLAGS: -Ctarget-feature=+crt-static
2930

3031
steps:
3132
- uses: actions/checkout@v4

lib-cpp/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fn main() {
1010
CFG.include_prefix = "crate-root";
1111

1212
cxx_build::bridge("src/lib.rs")
13+
.flag("/MT")
1314
.files(
1415
glob("cpp/src/*.cc")
1516
.expect("Failed to read cpp files")

0 commit comments

Comments
 (0)