Skip to content

Commit c542180

Browse files
Merge pull request #5084 from kateinoigakukun/yt/wasi-cmake-var
CMake: Fix accidental variable expansion of `WASI`
2 parents 86a733f + 9c03e2e commit c542180

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ if(BUILD_SHARED_LIBS)
6464
endif()
6565

6666
set(FOUNDATION_BUILD_NETWORKING_default ON)
67-
if(CMAKE_SYSTEM_NAME STREQUAL WASI)
67+
if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
6868
# Networking is not supported on WASI
6969
set(FOUNDATION_BUILD_NETWORKING_default OFF)
7070
endif()
@@ -133,7 +133,7 @@ endif()
133133
# System dependencies
134134

135135
# We know libdispatch is always unavailable on WASI
136-
if(NOT CMAKE_SYSTEM_NAME STREQUAL WASI)
136+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WASI")
137137
find_package(LibRT)
138138
find_package(dispatch CONFIG)
139139
if(NOT dispatch_FOUND)
@@ -170,7 +170,7 @@ list(APPEND _Foundation_common_build_flags
170170
"-Wno-switch"
171171
"-fblocks")
172172

173-
if(NOT CMAKE_SYSTEM_NAME STREQUAL WASI)
173+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WASI")
174174
list(APPEND _Foundation_common_build_flags
175175
"-DDEPLOYMENT_ENABLE_LIBDISPATCH"
176176
"-DSWIFT_CORELIBS_FOUNDATION_HAS_THREADS")
@@ -206,7 +206,7 @@ list(APPEND _Foundation_swift_build_flags
206206
"-Xfrontend"
207207
"-require-explicit-sendable")
208208

209-
if(CMAKE_SYSTEM_NAME STREQUAL WASI)
209+
if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
210210
# Enable wasi-libc emulation features
211211
set(WASI_EMULATION_DEFS _WASI_EMULATED_MMAN _WASI_EMULATED_SIGNAL _WASI_EMULATED_PROCESS_CLOCKS)
212212
foreach(def ${WASI_EMULATION_DEFS})

Sources/CoreFoundation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ target_link_libraries(CoreFoundation
119119
_FoundationICU
120120
dispatch)
121121

122-
if(CMAKE_SYSTEM_NAME STREQUAL WASI)
122+
if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
123123
# On WASI, we use vendored BlocksRuntime instead of the one from libdispatch
124124
add_subdirectory(BlockRuntime)
125125
# Add BlocksRuntime object library to CoreFoundation static archive

Sources/_CFXMLInterface/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ target_link_libraries(_CFXMLInterface PRIVATE
3333
dispatch
3434
LibXml2::LibXml2)
3535

36-
if(CMAKE_SYSTEM_NAME STREQUAL WASI)
36+
if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
3737
target_link_libraries(_CFXMLInterface PRIVATE BlocksRuntime)
3838
endif()
3939

0 commit comments

Comments
 (0)