File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -1339,12 +1339,13 @@ impl Build {
1339
1339
}
1340
1340
// Link c++ lib from WASI sysroot
1341
1341
if Build :: is_wasi_target ( target. as_ref ( ) ) {
1342
- let wasi_sysroot = self . wasi_sysroot ( ) ?;
1343
- self . cargo_output . print_metadata ( & format_args ! (
1344
- "cargo:rustc-flags=-L {}/lib/{} -lstatic=c++ -lstatic=c++abi" ,
1345
- Path :: new( & wasi_sysroot) . display( ) ,
1346
- target
1347
- ) ) ;
1342
+ if let Ok ( wasi_sysroot) = self . wasi_sysroot ( ) {
1343
+ self . cargo_output . print_metadata ( & format_args ! (
1344
+ "cargo:rustc-flags=-L {}/lib/{} -lstatic=c++ -lstatic=c++abi" ,
1345
+ Path :: new( & wasi_sysroot) . display( ) ,
1346
+ target
1347
+ ) ) ;
1348
+ }
1348
1349
}
1349
1350
}
1350
1351
@@ -1950,10 +1951,11 @@ impl Build {
1950
1951
// https://github.com/WebAssembly/exception-handling
1951
1952
cmd. push_cc_arg ( "-fno-exceptions" . into ( ) ) ;
1952
1953
// Link clang sysroot
1953
- let wasi_sysroot = self . wasi_sysroot ( ) ?;
1954
- cmd. push_cc_arg (
1955
- format ! ( "--sysroot={}" , Path :: new( & wasi_sysroot) . display( ) ) . into ( ) ,
1956
- ) ;
1954
+ if let Ok ( wasi_sysroot) = self . wasi_sysroot ( ) {
1955
+ cmd. push_cc_arg (
1956
+ format ! ( "--sysroot={}" , Path :: new( & wasi_sysroot) . display( ) ) . into ( ) ,
1957
+ ) ;
1958
+ }
1957
1959
}
1958
1960
}
1959
1961
}
You can’t perform that action at this time.
0 commit comments