forked from swiftlang/swift-corelibs-foundation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
691 lines (668 loc) · 28.9 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
cmake_minimum_required(VERSION 3.4.3)
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
project(CoreFoundation
VERSION
1338
LANGUAGES
ASM C)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED YES)
# TODO(compnerd): this should be re-enabled once CoreFoundation annotations have
# been reconciled. Hidden visibility should ensure that internal interfaces are
# not accidentally exposed on platforms without exports lists and explicit
# annotations (i.e. ELFish and MachO targets).
if(0)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_C_VISIBILITY_INLINES_HIDDEN ON)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG ON)
if(CMAKE_VERSION VERSION_LESS 3.10)
if(CMAKE_CROSSCOMPILING)
if(NOT CMAKE_C_COMPILER_ID MATCHES Clang OR CMAKE_C_SIMULATE_ID STREQUAL MSVC)
set(THREADS_HAVE_PTHREAD_ARG FALSE)
else()
set(THREADS_HAVE_PTHREAD_ARG TRUE)
endif()
endif()
endif()
find_package(Threads)
include(GNUInstallDirs)
include(CoreFoundationAddFramework)
option(CF_PATH_TO_LIBDISPATCH_SOURCE "Path to libdispatch source")
option(CF_PATH_TO_LIBDISPATCH_BUILD "Path to libdispatch build")
option(CF_DEPLOYMENT_SWIFT "Build for swift" NO)
if(BUILD_SHARED_LIBS)
set(FRAMEWORK_LIBRARY_TYPE SHARED)
else()
set(FRAMEWORK_LIBRARY_TYPE STATIC)
endif()
add_framework(CoreFoundation
${FRAMEWORK_LIBRARY_TYPE}
FRAMEWORK_DIRECTORY
CoreFoundation_FRAMEWORK_DIRECTORY
MODULE_MAP
Base.subproj/module.modulemap
PRIVATE_HEADERS
# Base
Base.subproj/CFAsmMacros.h
Base.subproj/CFInternal.h
Base.subproj/CFKnownLocations.h
Base.subproj/CFLogUtilities.h
Base.subproj/CFPriv.h
Base.subproj/CFOverflow.h
Base.subproj/CFRuntime.h
Base.subproj/CFRuntime_Internal.h
Base.subproj/ForFoundationOnly.h
Base.subproj/ForSwiftFoundationOnly.h
# Collections
Collections.subproj/CFBasicHash.h
Collections.subproj/CFStorage.h
Collections.subproj/CFCollections_Internal.h
# Error
Error.subproj/CFError_Private.h
# Locale
Locale.subproj/CFCalendar_Internal.h
Locale.subproj/CFDateComponents.h
Locale.subproj/CFDateFormatter_Private.h
Locale.subproj/CFDateIntervalFormatter.h
Locale.subproj/CFDateInterval.h
Locale.subproj/CFICULogging.h
Locale.subproj/CFLocaleInternal.h
Locale.subproj/CFLocale_Private.h
# NumberDate
NumberDate.subproj/CFBigNumber.h
# Parsing
Parsing.subproj/CFPropertyList_Private.h
Parsing.subproj/CFXMLInputStream.h
# PlugIn
PlugIn.subproj/CFBundlePriv.h
PlugIn.subproj/CFBundle_BinaryTypes.h
PlugIn.subproj/CFBundle_Internal.h
PlugIn.subproj/CFPlugIn_Factory.h
# RunLoop
RunLoop.subproj/CFMachPort_Internal.h
RunLoop.subproj/CFMachPort_Lifetime.h
# Stream
Stream.subproj/CFStreamAbstract.h
Stream.subproj/CFStreamInternal.h
Stream.subproj/CFStreamPriv.h
# String
String.subproj/CFAttributedStringPriv.h
String.subproj/CFBurstTrie.h
String.subproj/CFCharacterSetPriv.h
String.subproj/CFRegularExpression.h
String.subproj/CFRunArray.h
String.subproj/CFString_Internal.h
String.subproj/CFStringDefaultEncoding.h
String.subproj/CFStringLocalizedFormattingInternal.h
# StringEncodings
StringEncodings.subproj/CFICUConverters.h
StringEncodings.subproj/CFStringEncodingConverter.h
StringEncodings.subproj/CFStringEncodingConverterExt.h
StringEncodings.subproj/CFStringEncodingConverterPriv.h
StringEncodings.subproj/CFStringEncodingDatabase.h
StringEncodings.subproj/CFUniChar.h
StringEncodings.subproj/CFUniCharPriv.h
StringEncodings.subproj/CFUnicodeDecomposition.h
StringEncodings.subproj/CFUnicodePrecomposition.h
# URL
URL.subproj/CFURL.inc.h
URL.subproj/CFURLPriv.h
URL.subproj/CFURLSessionInterface.h
PUBLIC_HEADERS
# FIXME: PrivateHeaders referenced by public headers
Base.subproj/CFKnownLocations.h
Base.subproj/CFLocking.h
Base.subproj/CFLogUtilities.h
Base.subproj/CFPriv.h
Base.subproj/CFRuntime.h
Base.subproj/ForFoundationOnly.h
Base.subproj/ForSwiftFoundationOnly.h
Locale.subproj/CFCalendar_Internal.h
Locale.subproj/CFDateComponents.h
Locale.subproj/CFDateInterval.h
Locale.subproj/CFLocaleInternal.h
PlugIn.subproj/CFBundlePriv.h
Stream.subproj/CFStreamPriv.h
String.subproj/CFCharacterSetPriv.h
String.subproj/CFRegularExpression.h
String.subproj/CFRunArray.h
StringEncodings.subproj/CFStringEncodingConverter.h
StringEncodings.subproj/CFStringEncodingConverterExt.h
URL.subproj/CFURLPriv.h
URL.subproj/CFURLSessionInterface.h
Locale.subproj/CFDateIntervalFormatter.h
# AppServices
AppServices.subproj/CFNotificationCenter.h
AppServices.subproj/CFUserNotification.h
# Base
Base.subproj/CFAvailability.h
Base.subproj/CFBase.h
Base.subproj/CFByteOrder.h
Base.subproj/CFUUID.h
Base.subproj/CFUtilities.h
Base.subproj/SwiftRuntime/CoreFoundation.h
Base.subproj/SwiftRuntime/TargetConditionals.h
# Collections
Collections.subproj/CFArray.h
Collections.subproj/CFBag.h
Collections.subproj/CFBinaryHeap.h
Collections.subproj/CFBitVector.h
Collections.subproj/CFData.h
Collections.subproj/CFDictionary.h
Collections.subproj/CFSet.h
Collections.subproj/CFTree.h
# Error
Error.subproj/CFError.h
# Locale
Locale.subproj/CFCalendar.h
Locale.subproj/CFDateFormatter.h
Locale.subproj/CFLocale.h
Locale.subproj/CFNumberFormatter.h
# NumberDate
NumberDate.subproj/CFDate.h
NumberDate.subproj/CFNumber.h
NumberDate.subproj/CFTimeZone.h
# Parsing
Parsing.subproj/CFPropertyList.h
Parsing.subproj/CFXMLNode.h
Parsing.subproj/CFXMLParser.h
# PlugIn
PlugIn.subproj/CFBundle.h
PlugIn.subproj/CFPlugIn.h
PlugIn.subproj/CFPlugInCOM.h
# Preferences
Preferences.subproj/CFPreferences.h
# RunLoop
RunLoop.subproj/CFMachPort.h
RunLoop.subproj/CFMessagePort.h
RunLoop.subproj/CFRunLoop.h
RunLoop.subproj/CFSocket.h
# Stream
Stream.subproj/CFStream.h
# String
String.subproj/CFAttributedString.h
String.subproj/CFCharacterSet.h
String.subproj/CFString.h
String.subproj/CFStringEncodingExt.h
# URL
URL.subproj/CFURL.h
URL.subproj/CFURLAccess.h
URL.subproj/CFURLComponents.h
SOURCES
# Base
Base.subproj/CFBase.c
Base.subproj/CFFileUtilities.c
Base.subproj/CFKnownLocations.c
Base.subproj/CFPlatform.c
Base.subproj/CFRuntime.c
Base.subproj/CFSortFunctions.c
Base.subproj/CFSystemDirectories.c
Base.subproj/CFUtilities.c
Base.subproj/CFUUID.c
Base.subproj/CFWindowsUtilities.c
# Collections
Collections.subproj/CFArray.c
Collections.subproj/CFBag.c
Collections.subproj/CFBasicHash.c
Collections.subproj/CFBinaryHeap.c
Collections.subproj/CFBitVector.c
Collections.subproj/CFData.c
Collections.subproj/CFDictionary.c
Collections.subproj/CFSet.c
Collections.subproj/CFStorage.c
Collections.subproj/CFTree.c
# Error
Error.subproj/CFError.c
# Locale
Locale.subproj/CFCalendar.c
Locale.subproj/CFCalendar_Enumerate.c
Locale.subproj/CFDateComponents.c
Locale.subproj/CFDateFormatter.c
Locale.subproj/CFDateIntervalFormatter.c
Locale.subproj/CFDateInterval.c
Locale.subproj/CFLocale.c
Locale.subproj/CFLocaleIdentifier.c
Locale.subproj/CFLocaleKeys.c
Locale.subproj/CFNumberFormatter.c
# NumberData
NumberDate.subproj/CFBigNumber.c
NumberDate.subproj/CFDate.c
NumberDate.subproj/CFNumber.c
NumberDate.subproj/CFTimeZone.c
# Parsing
Parsing.subproj/CFBinaryPList.c
Parsing.subproj/CFOldStylePList.c
Parsing.subproj/CFPropertyList.c
Parsing.subproj/CFXMLInputStream.c
Parsing.subproj/CFXMLNode.c
Parsing.subproj/CFXMLParser.c
Parsing.subproj/CFXMLTree.c
# PlugIn
PlugIn.subproj/CFBundle_Binary.c
PlugIn.subproj/CFBundle.c
PlugIn.subproj/CFBundle_DebugStrings.c
PlugIn.subproj/CFBundle_Executable.c
PlugIn.subproj/CFBundle_Grok.c
PlugIn.subproj/CFBundle_InfoPlist.c
PlugIn.subproj/CFBundle_Locale.c
PlugIn.subproj/CFBundle_Main.c
PlugIn.subproj/CFBundle_ResourceFork.c
PlugIn.subproj/CFBundle_Resources.c
PlugIn.subproj/CFBundle_Strings.c
PlugIn.subproj/CFBundle_Tables.c
PlugIn.subproj/CFPlugIn.c
PlugIn.subproj/CFPlugIn_Factory.c
PlugIn.subproj/CFPlugIn_Instance.c
PlugIn.subproj/CFPlugIn_PlugIn.c
# Preferences
Preferences.subproj/CFApplicationPreferences.c
Preferences.subproj/CFPreferences.c
Preferences.subproj/CFXMLPreferencesDomain.c
# RunLoop
# TODO(compnerd) make this empty on non-Mach targets
# RunLoop.subproj/CFMachPort.c
# RunLoop.subproj/CFMachPort_Lifetime.c
# RunLoop.subproj/CFMessagePort.c
RunLoop.subproj/CFRunLoop.c
RunLoop.subproj/CFSocket.c
# Stream
Stream.subproj/CFConcreteStreams.c
Stream.subproj/CFSocketStream.c
Stream.subproj/CFStream.c
# String
String.subproj/CFAttributedString.c
String.subproj/CFBurstTrie.c
String.subproj/CFCharacterSet.c
String.subproj/CFCharacterSetData.S
String.subproj/CFRegularExpression.c
String.subproj/CFRunArray.c
String.subproj/CFString.c
String.subproj/CFStringEncodings.c
String.subproj/CFStringScanner.c
String.subproj/CFStringTransform.c
String.subproj/CFStringUtilities.c
String.subproj/CFUniCharPropertyDatabase.S
String.subproj/CFUnicodeData.S
# StringEncodings
StringEncodings.subproj/CFBuiltinConverters.c
StringEncodings.subproj/CFICUConverters.c
StringEncodings.subproj/CFPlatformConverters.c
StringEncodings.subproj/CFStringEncodingConverter.c
StringEncodings.subproj/CFStringEncodingDatabase.c
StringEncodings.subproj/CFUniChar.c
StringEncodings.subproj/CFUnicodeDecomposition.c
StringEncodings.subproj/CFUnicodePrecomposition.c
# URL
URL.subproj/CFURLAccess.c
URL.subproj/CFURL.c
URL.subproj/CFURLComponents.c
URL.subproj/CFURLComponents_URIParser.c)
add_framework(CFURLSessionInterface
${FRAMEWORK_LIBRARY_TYPE}
FRAMEWORK_DIRECTORY
CFURLSessionInterface_FRAMEWORK_DIRECTORY
MODULE_MAP
URL.subproj/module.modulemap
PRIVATE_HEADERS
URL.subproj/CFURLSessionInterface.h
PUBLIC_HEADERS
URL.subproj/CFURLSessionInterface.h
SOURCES
URL.subproj/CFURLSessionInterface.c)
add_dependencies(CFURLSessionInterface CoreFoundation)
add_framework(CFXMLInterface
${FRAMEWORK_LIBRARY_TYPE}
FRAMEWORK_DIRECTORY
CFXMLInterface_FRAMEWORK_DIRECTORY
MODULE_MAP
Parsing.subproj/module.modulemap
PRIVATE_HEADERS
Parsing.subproj/CFXMLInterface.h
PUBLIC_HEADERS
Parsing.subproj/CFXMLInterface.h
SOURCES
Parsing.subproj/CFXMLInterface.c)
add_dependencies(CFXMLInterface CoreFoundation)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
add_library(CoreFoundationResources OBJECT
CoreFoundation.rc)
if(BUILD_SHARED_LIBS)
target_link_libraries(CoreFoundation PRIVATE CoreFoundationResources)
else()
target_link_libraries(CoreFoundation INTERFACE CoreFoundationResources)
endif()
# NOTE(compnerd) the WindowsOlsonMapping.plist and OlsonWindowsMapping.plist
# are embedded Windows resources that we use to map the Windows timezone to
# the Olson name. Ensure that we rebuild on regeneration of the files.
add_custom_target(CoreFoundationWindowsTimeZonesPLists DEPENDS
WindowsOlsonMapping.plist
OlsonWindowsMapping.plist)
add_dependencies(CoreFoundation CoreFoundationWindowsTimeZonesPLists)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL Linux OR CMAKE_SYSTEM_NAME STREQUAL Android)
target_compile_definitions(CoreFoundation
PRIVATE
-D_GNU_SOURCE)
target_compile_definitions(CFURLSessionInterface
PRIVATE
-D_GNU_SOURCE)
target_compile_definitions(CFXMLInterface
PRIVATE
-D_GNU_SOURCE)
if(HAVE_SCHED_GETAFFINITY)
target_compile_definitions(CoreFoundation
PRIVATE
-DHAVE_SCHED_GETAFFINITY)
target_compile_definitions(CFURLSessionInterface
PRIVATE
-DHAVE_SCHED_GETAFFINITY)
target_compile_definitions(CFXMLInterface
PRIVATE
-DHAVE_SCHED_GETAFFINITY)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
# NOTE(compnerd) we only support building with the dynamic CRT as using the
# static CRT causes problems for users of the library.
target_compile_definitions(CoreFoundation
PRIVATE
-D_DLL)
target_compile_definitions(CFURLSessionInterface
PRIVATE
-D_DLL)
target_compile_definitions(CFXMLInterface
PRIVATE
-D_DLL)
if(BUILD_SHARED_LIBS)
target_compile_definitions(CoreFoundation
PRIVATE
-D_WINDLL)
target_compile_definitions(CFURLSessionInterface
PRIVATE
-D_WINDLL)
target_compile_definitions(CFXMLInterface
PRIVATE
-D_WINDLL)
endif()
target_compile_definitions(CFURLSessionInterface
PRIVATE
-DCURL_STATICLIB)
endif()
target_compile_definitions(CoreFoundation
PRIVATE
-DU_SHOW_DRAFT_API
-DCF_BUILDING_CF)
target_compile_definitions(CFURLSessionInterface
PRIVATE
-DU_SHOW_DRAFT_API
-DCF_BUILDING_CF)
target_compile_definitions(CFXMLInterface
PRIVATE
-DU_SHOW_DRAFT_API
-DCF_BUILDING_CF)
if(CF_DEPLOYMENT_SWIFT)
target_compile_definitions(CoreFoundation
PRIVATE
-DDEPLOYMENT_RUNTIME_SWIFT)
target_compile_definitions(CFURLSessionInterface
PRIVATE
-DDEPLOYMENT_RUNTIME_SWIFT)
target_compile_definitions(CFXMLInterface
PRIVATE
-DDEPLOYMENT_RUNTIME_SWIFT)
else()
target_compile_definitions(CoreFoundation
PRIVATE
-DDEPLOYMENT_RUNTIME_C)
target_compile_definitions(CFURLSessionInterface
PRIVATE
-DDEPLOYMENT_RUNTIME_C)
target_compile_definitions(CFXMLInterface
PRIVATE
-DDEPLOYMENT_RUNTIME_C)
endif()
target_compile_definitions(CoreFoundation
PRIVATE
$<$<COMPILE_LANGUAGE:ASM>:CF_CHARACTERSET_BITMAP="CharacterSets/CFCharacterSetBitmaps.bitmap">
$<$<COMPILE_LANGUAGE:ASM>:CF_CHARACTERSET_UNICHAR_DB="CharacterSets/CFUniCharPropertyDatabase.data">
$<$<COMPILE_LANGUAGE:ASM>:CF_CHARACTERSET_UNICODE_DATA_B="CharacterSets/CFUnicodeData-B.mapping">
$<$<COMPILE_LANGUAGE:ASM>:CF_CHARACTERSET_UNICODE_DATA_L="CharacterSets/CFUnicodeData-L.mapping">)
target_include_directories(CoreFoundation
PRIVATE
${PROJECT_SOURCE_DIR})
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
find_package(LibXml2 REQUIRED)
target_include_directories(CFXMLInterface
PRIVATE
${LIBXML2_INCLUDE_DIR})
find_package(CURL REQUIRED)
target_include_directories(CFURLSessionInterface
PRIVATE
${CURL_INCLUDE_DIRS})
find_package(ICU COMPONENTS uc i18n REQUIRED)
target_include_directories(CoreFoundation
PRIVATE
${ICU_INCLUDE_DIR})
endif()
target_include_directories(CoreFoundation
PRIVATE
${CF_PATH_TO_LIBDISPATCH_SOURCE}
${CF_PATH_TO_LIBDISPATCH_BUILD}/tests)
target_include_directories(CFURLSessionInterface
PRIVATE
${CF_PATH_TO_LIBDISPATCH_SOURCE}
${CF_PATH_TO_LIBDISPATCH_BUILD}/tests)
target_include_directories(CFXMLInterface
PRIVATE
${CF_PATH_TO_LIBDISPATCH_SOURCE}
${CF_PATH_TO_LIBDISPATCH_BUILD}/tests)
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
target_include_directories(CoreFoundation
SYSTEM PRIVATE
${CF_PATH_TO_LIBDISPATCH_SOURCE}/src/BlocksRuntime)
target_include_directories(CFURLSessionInterface
SYSTEM PRIVATE
${CF_PATH_TO_LIBDISPATCH_SOURCE}/src/BlocksRuntime)
target_include_directories(CFXMLInterface
SYSTEM PRIVATE
${CF_PATH_TO_LIBDISPATCH_SOURCE}/src/BlocksRuntime)
endif()
if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
target_compile_options(CoreFoundation
PRIVATE
$<$<COMPILE_LANGUAGE:C>:/FI${PROJECT_SOURCE_DIR}/Base.subproj/CoreFoundation_Prefix.h>)
target_compile_options(CFURLSessionInterface
PRIVATE
$<$<COMPILE_LANGUAGE:C>:/FI${PROJECT_SOURCE_DIR}/Base.subproj/CoreFoundation_Prefix.h>)
target_compile_options(CFXMLInterface
PRIVATE
$<$<COMPILE_LANGUAGE:C>:/FI${PROJECT_SOURCE_DIR}/Base.subproj/CoreFoundation_Prefix.h>)
else()
target_compile_options(CoreFoundation
PRIVATE
$<$<COMPILE_LANGUAGE:C>:-include;${PROJECT_SOURCE_DIR}/Base.subproj/CoreFoundation_Prefix.h>)
target_compile_options(CFURLSessionInterface
PRIVATE
$<$<COMPILE_LANGUAGE:C>:-include;${PROJECT_SOURCE_DIR}/Base.subproj/CoreFoundation_Prefix.h>)
target_compile_options(CFXMLInterface
PRIVATE
$<$<COMPILE_LANGUAGE:C>:-include;${PROJECT_SOURCE_DIR}/Base.subproj/CoreFoundation_Prefix.h>)
endif()
if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
target_compile_options(CoreFoundation
PRIVATE
-fblocks
/EHsc)
target_compile_options(CFURLSessionInterface
PRIVATE
-fblocks
/EHsc)
target_compile_options(CFXMLInterface
PRIVATE
-fblocks
/EHsc)
else()
target_compile_options(CoreFoundation
PRIVATE
-fblocks
-fconstant-cfstrings
-fdollars-in-identifiers
-fexceptions
-fno-common)
target_compile_options(CFURLSessionInterface
PRIVATE
-fblocks
-fconstant-cfstrings
-fdollars-in-identifiers
-fexceptions
-fno-common)
target_compile_options(CFXMLInterface
PRIVATE
-fblocks
-fconstant-cfstrings
-fdollars-in-identifiers
-fexceptions
-fno-common)
endif()
if(CF_DEPLOYMENT_SWIFT)
if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
target_compile_options(CoreFoundation
PRIVATE
/clang:-fcf-runtime-abi=swift)
target_compile_options(CFURLSessionInterface
PRIVATE
/clang:-fcf-runtime-abi=swift)
target_compile_options(CFXMLInterface
PRIVATE
/clang:-fcf-runtime-abi=swift)
else()
target_compile_options(CoreFoundation
PRIVATE
-fcf-runtime-abi=swift)
target_compile_options(CFURLSessionInterface
PRIVATE
-fcf-runtime-abi=swift)
target_compile_options(CFXMLInterface
PRIVATE
-fcf-runtime-abi=swift)
endif()
endif()
target_compile_options(CoreFoundation
PRIVATE
-Wno-shorten-64-to-32
-Wno-deprecated-declarations
-Wno-unreachable-code
-Wno-conditional-uninitialized
-Wno-unused-variable
-Wno-int-conversion
-Wno-unused-function
-Wno-microsoft-enum-forward-reference)
target_compile_options(CFURLSessionInterface
PRIVATE
-Wno-shorten-64-to-32
-Wno-deprecated-declarations
-Wno-unreachable-code
-Wno-conditional-uninitialized
-Wno-unused-variable
-Wno-int-conversion
-Wno-unused-function
-Wno-microsoft-enum-forward-reference)
target_compile_options(CFXMLInterface
PRIVATE
-Wno-shorten-64-to-32
-Wno-deprecated-declarations
-Wno-unreachable-code
-Wno-conditional-uninitialized
-Wno-unused-variable
-Wno-int-conversion
-Wno-unused-function
-Wno-microsoft-enum-forward-reference)
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
target_link_libraries(CFXMLInterface
PRIVATE
${LIBXML2_LIBRARIES})
target_link_libraries(CFURLSessionInterface
PRIVATE
${CURL_LIBRARIES})
endif()
if(CMAKE_SYSTEM_NAME STREQUAL Android)
target_link_libraries(CoreFoundation
PRIVATE
log)
endif()
target_link_libraries(CoreFoundation
PRIVATE
Threads::Threads
${CMAKE_DL_LIBS})
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_link_libraries(CoreFoundation
PRIVATE
AdvAPI32
Secur32
User32
mincore)
target_link_libraries(CFURLSessionInterface
PRIVATE
AdvAPI32
Secur32
User32
mincore)
target_link_libraries(CFXMLInterface
PRIVATE
AdvAPI32
Secur32
User32
mincore)
endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
target_link_libraries(CoreFoundation
PRIVATE
m)
target_link_libraries(CFURLSessionInterface
PRIVATE
m)
target_link_libraries(CFXMLInterface
PRIVATE
m)
endif()
target_link_libraries(CoreFoundation
PRIVATE
dispatch)
target_link_libraries(CFURLSessionInterface
PRIVATE
dispatch)
target_link_libraries(CFXMLInterface
PRIVATE
dispatch)
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
target_link_libraries(CoreFoundation
PRIVATE
icucore)
target_link_libraries(CFURLSessionInterface
PRIVATE
icucore)
target_link_libraries(CFXMLInterface
PRIVATE
icucore)
set_target_properties(CoreFoundation
PROPERTIES LINK_FLAGS
-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)
endif()
install(TARGETS
CoreFoundation
CFURLSessionInterface
CFXMLInterface
DESTINATION
"${CMAKE_INSTALL_FULL_LIBDIR}")
# Needed to avoid double slash "//" when CMAKE_INSTALL_PREFIX set to "/" and DESTDIR used to relocate whole installation.
# Double slash raise CMake error "file called with network path DESTINATION //System/Library/Frameworks".
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
install(DIRECTORY
${CoreFoundation_FRAMEWORK_DIRECTORY}
DESTINATION
${CMAKE_INSTALL_PREFIX}/System/Library/Frameworks
USE_SOURCE_PERMISSIONS
PATTERN PrivateHeaders EXCLUDE)