@@ -115,7 +115,6 @@ list(APPEND _Foundation_common_build_flags
115
115
"-DCF_BUILDING_CF"
116
116
"-DDEPLOYMENT_ENABLE_LIBDISPATCH"
117
117
"-DHAVE_STRUCT_TIMESPEC"
118
- "-DSWIFT_CORELIBS_FOUNDATION_HAS_THREADS"
119
118
"-Wno-shorten-64-to-32"
120
119
"-Wno-deprecated-declarations"
121
120
"-Wno-unreachable-code"
@@ -127,6 +126,18 @@ list(APPEND _Foundation_common_build_flags
127
126
"-Wno-switch"
128
127
"-fblocks" )
129
128
129
+ if (CMAKE_SYSTEM_NAME STREQUAL "WASI" )
130
+ list (APPEND _Foundation_common_build_flags
131
+ "-D_WASI_EMULATED_SIGNAL"
132
+ "-DHAVE_STRLCPY"
133
+ "-DHAVE_STRLCAT"
134
+ )
135
+ else ()
136
+ list (APPEND _Foundation_common_build_flags
137
+ "-DSWIFT_CORELIBS_FOUNDATION_HAS_THREADS"
138
+ )
139
+ endif ()
140
+
130
141
if (NOT "${CMAKE_C_SIMULATE_ID} " STREQUAL "MSVC" )
131
142
list (APPEND _Foundation_common_build_flags
132
143
"-fconstant-cfstrings"
@@ -154,10 +165,21 @@ set(_Foundation_swift_build_flags)
154
165
list (APPEND _Foundation_swift_build_flags
155
166
"-swift-version 6"
156
167
"-DDEPLOYMENT_RUNTIME_SWIFT"
157
- "-DSWIFT_CORELIBS_FOUNDATION_HAS_THREADS"
158
168
"-Xfrontend"
159
169
"-require-explicit-sendable" )
160
170
171
+ if (CMAKE_SYSTEM_NAME STREQUAL "WASI" )
172
+ list (APPEND _Foundation_swift_build_flags
173
+ "-D_WASI_EMULATED_SIGNAL"
174
+ "-DHAVE_STRLCPY"
175
+ "-DHAVE_STRLCAT"
176
+ )
177
+ else ()
178
+ list (APPEND _Foundation_swift_build_flags
179
+ "-DSWIFT_CORELIBS_FOUNDATION_HAS_THREADS"
180
+ )
181
+ endif ()
182
+
161
183
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android" )
162
184
list (APPEND _Foundation_common_build_flags
163
185
"-D_GNU_SOURCE" )
0 commit comments