File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -487,6 +487,14 @@ set(SWIFT_ANDROID_NDK_PATH "" CACHE STRING
487
487
set (SWIFT_ANDROID_DEPLOY_DEVICE_PATH "" CACHE STRING
488
488
"Path on an Android device where build products will be pushed. These are used when running the test suite against the device" )
489
489
490
+ #
491
+ # User-configurable WebAssembly specific options.
492
+ #
493
+
494
+ option (SWIFT_ENABLE_WASI_THREADS
495
+ "Build the Standard Library with WASI threads support"
496
+ FALSE )
497
+
490
498
#
491
499
# User-configurable Darwin-specific options.
492
500
#
Original file line number Diff line number Diff line change @@ -329,7 +329,11 @@ macro(configure_sdk_unix name architectures)
329
329
if ("${prefix} " STREQUAL "LINUX" )
330
330
set (_default_threading_package "linux" )
331
331
elseif ("${prefix} " STREQUAL "WASI" )
332
- set (_default_threading_package "none" )
332
+ if (SWIFT_ENABLE_WASI_THREADS )
333
+ set (_default_threading_package "pthreads" )
334
+ else ()
335
+ set (_default_threading_package "none" )
336
+ endif ()
333
337
endif ()
334
338
get_threading_package (${prefix} ${_default_threading_package}
335
339
SWIFT_SDK_${prefix}_THREADING_PACKAGE )
@@ -418,7 +422,11 @@ macro(configure_sdk_unix name architectures)
418
422
message (FATAL_ERROR "unsupported arch for WebAssembly: ${arch} " )
419
423
endif ()
420
424
set (SWIFT_SDK_WASI_ARCH_wasm32_PATH "${SWIFT_WASI_SYSROOT_PATH} " )
421
- set (SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi" )
425
+ if (SWIFT_ENABLE_WASI_THREADS )
426
+ set (SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi-threads" )
427
+ else ()
428
+ set (SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi" )
429
+ endif ()
422
430
else ()
423
431
message (FATAL_ERROR "unknown Unix OS: ${prefix} " )
424
432
endif ()
You can’t perform that action at this time.
0 commit comments