@@ -39,14 +39,12 @@ let coreFoundationBuildSettings: [CSetting] = [
39
39
. headerSearchPath( " internalInclude " ) ,
40
40
. define( " DEBUG " , . when( configuration: . debug) ) ,
41
41
. define( " CF_BUILDING_CF " ) ,
42
- . define( " DEPLOYMENT_ENABLE_LIBDISPATCH " ) ,
42
+ . define( " DEPLOYMENT_ENABLE_LIBDISPATCH " , . when ( platforms : platformsWithThreads ) ) ,
43
43
. define( " DEPLOYMENT_RUNTIME_SWIFT " ) ,
44
44
. define( " HAVE_STRUCT_TIMESPEC " ) ,
45
45
. define( " SWIFT_CORELIBS_FOUNDATION_HAS_THREADS " , . when( platforms: platformsWithThreads) ) ,
46
46
. define( " _GNU_SOURCE " , . when( platforms: [ . linux, . android] ) ) ,
47
47
. define( " _WASI_EMULATED_SIGNAL " , . when( platforms: [ . wasi] ) ) ,
48
- . define( " HAVE_STRLCPY " , . when( platforms: [ . wasi] ) ) ,
49
- . define( " HAVE_STRLCAT " , . when( platforms: [ . wasi] ) ) ,
50
48
. unsafeFlags( [
51
49
" -Wno-shorten-64-to-32 " ,
52
50
" -Wno-deprecated-declarations " ,
@@ -78,8 +76,6 @@ let interfaceBuildSettings: [CSetting] = [
78
76
. define( " SWIFT_CORELIBS_FOUNDATION_HAS_THREADS " , . when( platforms: platformsWithThreads) ) ,
79
77
. define( " _GNU_SOURCE " , . when( platforms: [ . linux, . android] ) ) ,
80
78
. define( " _WASI_EMULATED_SIGNAL " , . when( platforms: [ . wasi] ) ) ,
81
- . define( " HAVE_STRLCPY " , . when( platforms: [ . wasi] ) ) ,
82
- . define( " HAVE_STRLCAT " , . when( platforms: [ . wasi] ) ) ,
83
79
. unsafeFlags( [
84
80
" -Wno-shorten-64-to-32 " ,
85
81
" -Wno-deprecated-declarations " ,
@@ -161,7 +157,8 @@ let package = Package(
161
157
. product( name: " FoundationEssentials " , package : " swift-foundation " ) ,
162
158
" Foundation " ,
163
159
" CoreFoundation " ,
164
- " _CFXMLInterface "
160
+ " _CFXMLInterface " ,
161
+ . target( name: " BlocksRuntime " , condition: . when( platforms: [ . wasi] ) ) ,
165
162
] ,
166
163
path: " Sources/FoundationXML " ,
167
164
exclude: [
@@ -187,6 +184,7 @@ let package = Package(
187
184
name: " CoreFoundation " ,
188
185
dependencies: [
189
186
. product( name: " _FoundationICU " , package : " swift-foundation-icu " ) ,
187
+ . target( name: " BlocksRuntime " , condition: . when( platforms: [ . wasi] ) ) ,
190
188
] ,
191
189
path: " Sources/CoreFoundation " ,
192
190
exclude: [
@@ -195,6 +193,17 @@ let package = Package(
195
193
] ,
196
194
cSettings: coreFoundationBuildSettings
197
195
) ,
196
+ . target(
197
+ name: " BlocksRuntime " ,
198
+ path: " Sources/CoreFoundation/BlockRuntime " ,
199
+ exclude: [
200
+ " CMakeLists.txt "
201
+ ] ,
202
+ cSettings: [
203
+ // For CFTargetConditionals.h
204
+ . headerSearchPath( " ../include " ) ,
205
+ ]
206
+ ) ,
198
207
. target(
199
208
name: " _CFXMLInterface " ,
200
209
dependencies: [
0 commit comments