File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ jobs:
174
174
yarn install
175
175
176
176
- name : Install wasi-sdk
177
+ if : ${{ matrix.settings.target == 'wasm32-wasip1-threads' }}
177
178
run : |
178
179
mkdir -p $HOME/wasi-sdk
179
180
curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz | tar -xzf - -C $HOME/wasi-sdk --strip-components=1
@@ -195,3 +196,9 @@ jobs:
195
196
yarn build --target ${{ matrix.settings.target }}
196
197
yarn build --target ${{ matrix.settings.target }} --release
197
198
fi
199
+ - name : Build with static CRT
200
+ if : ${{ matrix.settings.target == 'x86_64-pc-windows-msvc' }}
201
+ working-directory : example
202
+ run : yarn build --target ${{ matrix.settings.target }} --release
203
+ env :
204
+ RUSTFLAGS : " -C target-feature=+crt-static -C link-arg=/FORCE:MULTIPLE"
Original file line number Diff line number Diff line change @@ -83,10 +83,15 @@ fn main() {
83
83
cmake_config
84
84
. define ( "MI_USE_CXX" , "ON" )
85
85
. define ( "MI_WIN_USE_FIXED_TLS" , "ON" ) ;
86
- if profile == "debug" {
87
- println ! ( "cargo:rustc-link-lib=ucrtd" ) ;
88
- } else {
89
- println ! ( "cargo:rustc-link-lib=ucrt" ) ;
86
+ if !std:: env:: var ( "CARGO_CFG_TARGET_FEATURE" )
87
+ . map ( |s| s. contains ( "+crt-static" ) )
88
+ . unwrap_or ( false )
89
+ {
90
+ if profile == "debug" {
91
+ println ! ( "cargo:rustc-link-lib=ucrtd" ) ;
92
+ } else {
93
+ println ! ( "cargo:rustc-link-lib=ucrt" ) ;
94
+ }
90
95
}
91
96
}
92
97
You can’t perform that action at this time.
0 commit comments