Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ set(SWT_SOURCE_ROOT_DIR ${CMAKE_SOURCE_DIR})
project(SwiftTesting
LANGUAGES CXX Swift)

if(CMAKE_VERSION VERSION_LESS 3.31)
if(CMAKE_SYSTEM_NAME STREQUAL "Generic" AND CMAKE_SYSTEM_PROCESSOR MATCHES "wasm32")
set(CMAKE_SYSTEM_NAME WASI)
set(WASI 1)
endif()
endif()

if(NOT APPLE)
if(NOT CMAKE_SYSTEM_NAME STREQUAL WASI)
if(NOT WASI)
find_package(dispatch CONFIG)
endif()
find_package(Foundation CONFIG)
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/shared/CompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if(NOT APPLE)
add_compile_definitions("SWT_NO_SNAPSHOT_TYPES")
add_compile_definitions("SWT_NO_FOUNDATION_FILE_COORDINATION")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
if(WASI)
add_compile_definitions("SWT_NO_DYNAMIC_LINKING")
add_compile_definitions("SWT_NO_PIPES")
endif()
Expand All @@ -60,7 +60,7 @@ if(SWT_TESTING_LIBRARY_VERSION)
add_compile_definitions("$<$<COMPILE_LANGUAGE:CXX>:SWT_TESTING_LIBRARY_VERSION=\"${SWT_TESTING_LIBRARY_VERSION}\">")
endif()

if((NOT BUILD_SHARED_LIBS) AND (NOT CMAKE_SYSTEM_NAME STREQUAL WASI))
if((NOT BUILD_SHARED_LIBS) AND NOT WASI)
# When building a static library, Interop is not supported at this time
add_compile_definitions("SWT_NO_INTEROP")
endif()
Loading