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
487487set (SWIFT_ANDROID_DEPLOY_DEVICE_PATH "" CACHE STRING
488488 "Path on an Android device where build products will be pushed. These are used when running the test suite against the device" )
489489
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+
490498#
491499# User-configurable Darwin-specific options.
492500#
Original file line number Diff line number Diff line change @@ -329,7 +329,11 @@ macro(configure_sdk_unix name architectures)
329329 if ("${prefix} " STREQUAL "LINUX" )
330330 set (_default_threading_package "linux" )
331331 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 ()
333337 endif ()
334338 get_threading_package(${prefix} ${_default_threading_package}
335339 SWIFT_SDK_${prefix} _THREADING_PACKAGE)
@@ -418,7 +422,11 @@ macro(configure_sdk_unix name architectures)
418422 message (FATAL_ERROR "unsupported arch for WebAssembly: ${arch} " )
419423 endif ()
420424 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 ()
422430 else ()
423431 message (FATAL_ERROR "unknown Unix OS: ${prefix} " )
424432 endif ()
You can’t perform that action at this time.
0 commit comments