@@ -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">
@@ -406,6 +411,7 @@ add_framework(CFURLSessionInterface
406
411
URL.subproj/module.modulemap
407
412
PRIVATE_HEADERS
408
413
URL.subproj/CFURLSessionInterface.h
414
+ Base.subproj/SwiftRuntime/TargetConditionals.h
409
415
PUBLIC_HEADERS
410
416
URL.subproj/CFURLSessionInterface.h
411
417
SOURCES
@@ -421,6 +427,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
421
427
CURL::libcurl )
422
428
endif ()
423
429
430
+ if (CF_DEPLOYMENT_SWIFT )
424
431
add_framework (CFXMLInterface
425
432
${FRAMEWORK_LIBRARY_TYPE}
426
433
FRAMEWORK_DIRECTORY
@@ -438,6 +445,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
438
445
target_link_libraries (CFXMLInterface PRIVATE
439
446
LibXml2::LibXml2 )
440
447
endif ()
448
+ endif ()
441
449
442
450
if (CMAKE_SYSTEM_NAME STREQUAL Windows )
443
451
add_library (CoreFoundationResources OBJECT
@@ -470,33 +478,39 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
470
478
Secur32
471
479
User32
472
480
mincore )
481
+ if (CF_DEPLOYMENT_SWIFT )
473
482
target_link_libraries (CFXMLInterface
474
483
PRIVATE
475
484
AdvAPI32
476
485
Secur32
477
486
User32
478
487
mincore )
479
488
endif ()
489
+ endif ()
480
490
if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
481
491
target_link_libraries (CoreFoundation
482
492
PRIVATE
483
493
m )
484
494
target_link_libraries (CFURLSessionInterface
485
495
PRIVATE
486
496
m )
497
+ if (CF_DEPLOYMENT_SWIFT )
487
498
target_link_libraries (CFXMLInterface
488
499
PRIVATE
489
500
m )
490
501
endif ()
502
+ endif ()
491
503
target_link_libraries (CoreFoundation
492
504
PRIVATE
493
505
dispatch )
494
506
target_link_libraries (CFURLSessionInterface
495
507
PRIVATE
496
508
dispatch )
509
+ if (CF_DEPLOYMENT_SWIFT )
497
510
target_link_libraries (CFXMLInterface
498
511
PRIVATE
499
512
dispatch )
513
+ endif ()
500
514
if (CMAKE_SYSTEM_NAME STREQUAL Darwin )
501
515
target_link_libraries (CoreFoundation
502
516
PRIVATE
@@ -512,10 +526,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
512
526
-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
527
endif ()
514
528
529
+ if (CF_DEPLOYMENT_SWIFT )
530
+ set (CF_SWIFT_TARGETS CFXMLInterface )
531
+ endif ()
515
532
install (TARGETS
516
533
CoreFoundation
517
534
CFURLSessionInterface
518
- CFXMLInterface
535
+ ${CF_SWIFT_TARGETS}
519
536
DESTINATION
520
537
"${CMAKE_INSTALL_FULL_LIBDIR} " )
521
538
0 commit comments