@@ -111,6 +111,12 @@ else()
111
111
set (FRAMEWORK_LIBRARY_TYPE STATIC )
112
112
endif ()
113
113
114
+ set (CF_HEADER Base.subproj/CoreFoundation.h )
115
+ if (CF_DEPLOYMENT_SWIFT )
116
+ set (CF_HEADER Base.subproj/SwiftRuntime/CoreFoundation.h )
117
+ set (CF_SWIFT_PRIVATE_HEADERS Base.subproj/ForSwiftFoundationOnly.h )
118
+ set (CF_SWIFT_SOURCES Parsing.subproj/CFXMLNode.c Parsing.subproj/CFXMLParser.c )
119
+ endif ()
114
120
add_framework (CoreFoundation
115
121
${FRAMEWORK_LIBRARY_TYPE}
116
122
FRAMEWORK_DIRECTORY
@@ -128,7 +134,6 @@ add_framework(CoreFoundation
128
134
Base.subproj/CFRuntime.h
129
135
Base.subproj/CFRuntime_Internal.h
130
136
Base.subproj/ForFoundationOnly.h
131
- Base.subproj/ForSwiftFoundationOnly.h
132
137
# Collections
133
138
Collections.subproj/CFBasicHash.h
134
139
Collections.subproj/CFStorage.h
@@ -184,7 +189,9 @@ add_framework(CoreFoundation
184
189
URL.subproj/CFURL.inc.h
185
190
URL.subproj/CFURLPriv.h
186
191
URL.subproj/CFURLSessionInterface.h
192
+ ${CF_SWIFT_PRIVATE_HEADERS}
187
193
PUBLIC_HEADERS
194
+ ${CF_HEADER}
188
195
# FIXME: PrivateHeaders referenced by public headers
189
196
Base.subproj/CFKnownLocations.h
190
197
Base.subproj/CFLocking.h
@@ -217,7 +224,6 @@ add_framework(CoreFoundation
217
224
Base.subproj/CFByteOrder.h
218
225
Base.subproj/CFUUID.h
219
226
Base.subproj/CFUtilities.h
220
- Base.subproj/SwiftRuntime/CoreFoundation.h
221
227
Base.subproj/SwiftRuntime/TargetConditionals.h
222
228
# Collections
223
229
Collections.subproj/CFArray.h
@@ -311,8 +317,6 @@ add_framework(CoreFoundation
311
317
Parsing.subproj/CFOldStylePList.c
312
318
Parsing.subproj/CFPropertyList.c
313
319
Parsing.subproj/CFXMLInputStream.c
314
- Parsing.subproj/CFXMLNode.c
315
- Parsing.subproj/CFXMLParser.c
316
320
Parsing.subproj/CFXMLTree.c
317
321
# PlugIn
318
322
PlugIn.subproj/CFBundle_Binary.c
@@ -373,7 +377,8 @@ add_framework(CoreFoundation
373
377
URL.subproj/CFURLAccess.c
374
378
URL.subproj/CFURL.c
375
379
URL.subproj/CFURLComponents.c
376
- URL.subproj/CFURLComponents_URIParser.c )
380
+ URL.subproj/CFURLComponents_URIParser.c
381
+ ${CF_SWIFT_SOURCES} )
377
382
target_compile_definitions (CoreFoundation
378
383
PRIVATE
379
384
$< $< COMPILE_LANGUAGE:ASM> :CF_CHARACTERSET_BITMAP="CharacterSets/CFCharacterSetBitmaps.bitmap">
@@ -421,6 +426,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
421
426
CURL::libcurl )
422
427
endif ()
423
428
429
+ if (CF_DEPLOYMENT_SWIFT )
424
430
add_framework (CFXMLInterface
425
431
${FRAMEWORK_LIBRARY_TYPE}
426
432
FRAMEWORK_DIRECTORY
@@ -438,6 +444,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
438
444
target_link_libraries (CFXMLInterface PRIVATE
439
445
LibXml2::LibXml2 )
440
446
endif ()
447
+ endif ()
441
448
442
449
if (CMAKE_SYSTEM_NAME STREQUAL Windows )
443
450
add_library (CoreFoundationResources OBJECT
@@ -470,33 +477,39 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
470
477
Secur32
471
478
User32
472
479
mincore )
480
+ if (CF_DEPLOYMENT_SWIFT )
473
481
target_link_libraries (CFXMLInterface
474
482
PRIVATE
475
483
AdvAPI32
476
484
Secur32
477
485
User32
478
486
mincore )
479
487
endif ()
488
+ endif ()
480
489
if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
481
490
target_link_libraries (CoreFoundation
482
491
PRIVATE
483
492
m )
484
493
target_link_libraries (CFURLSessionInterface
485
494
PRIVATE
486
495
m )
496
+ if (CF_DEPLOYMENT_SWIFT )
487
497
target_link_libraries (CFXMLInterface
488
498
PRIVATE
489
499
m )
490
500
endif ()
501
+ endif ()
491
502
target_link_libraries (CoreFoundation
492
503
PRIVATE
493
504
dispatch )
494
505
target_link_libraries (CFURLSessionInterface
495
506
PRIVATE
496
507
dispatch )
508
+ if (CF_DEPLOYMENT_SWIFT )
497
509
target_link_libraries (CFXMLInterface
498
510
PRIVATE
499
511
dispatch )
512
+ endif ()
500
513
if (CMAKE_SYSTEM_NAME STREQUAL Darwin )
501
514
target_link_libraries (CoreFoundation
502
515
PRIVATE
@@ -512,10 +525,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
512
525
-Xlinker;-alias_list;-Xlinker;Base.subproj/DarwinSymbolAliases;-twolevel_namespace;-sectcreate;__UNICODE;__csbitmaps;CharacterSets/CFCharacterSetBitmaps.bitmap;-sectcreate;__UNICODE;__properties;CharacterSets/CFUniCharPropertyDatabase.data;-sectcreate;__UNICODE;__data;CharacterSets/CFUnicodeData-L.mapping;-segprot;__UNICODE;r;r )
513
526
endif ()
514
527
528
+ if (CF_DEPLOYMENT_SWIFT )
529
+ set (CF_SWIFT_TARGETS CFXMLInterface )
530
+ endif ()
515
531
install (TARGETS
516
532
CoreFoundation
517
533
CFURLSessionInterface
518
- CFXMLInterface
534
+ ${CF_SWIFT_TARGETS}
519
535
DESTINATION
520
536
"${CMAKE_INSTALL_FULL_LIBDIR} " )
521
537
0 commit comments