@@ -316,6 +316,21 @@ add_framework(CoreFoundation
316
316
URL.subproj/CFURLComponents.c
317
317
URL.subproj/CFURLComponents_URIParser.c
318
318
URL.subproj/CFURLSessionInterface.c)
319
+
320
+ add_framework(CFURLSessionInterface
321
+ ${FRAMEWORK_LIBRARY_TYPE}
322
+ FRAMEWORK_DIRECTORY
323
+ CoreFoundation_FRAMEWORK_DIRECTORY
324
+ MODULE_MAP
325
+ URL.subproj/module.modulemap
326
+ PRIVATE_HEADERS
327
+ URL.subproj/CFURLSessionInterface.h
328
+ PUBLIC_HEADERS
329
+ URL.subproj/CFURLSessionInterface.h
330
+ SOURCES
331
+ URL.subproj/CFURLSessionInterface.c)
332
+ add_dependencies (CFURLSessionInterface CoreFoundation)
333
+
319
334
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
320
335
add_library (CoreFoundationResources OBJECT
321
336
CoreFoundation.rc)
@@ -337,38 +352,63 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux OR CMAKE_SYSTEM_NAME STREQUAL Android)
337
352
target_compile_definitions (CoreFoundation
338
353
PRIVATE
339
354
-D_GNU_SOURCE)
355
+ target_compile_definitions (CFURLSessionInterface
356
+ PRIVATE
357
+ -D_GNU_SOURCE)
340
358
if (HAVE_SCHED_GETAFFINITY)
341
359
target_compile_definitions (CoreFoundation
342
360
PRIVATE
343
361
-DHAVE_SCHED_GETAFFINITY)
362
+ target_compile_definitions (CFURLSessionInterface
363
+ PRIVATE
364
+ -DHAVE_SCHED_GETAFFINITY)
344
365
endif ()
345
366
elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)
346
367
# NOTE(compnerd) we only support building with the dynamic CRT as using the
347
368
# static CRT causes problems for users of the library.
348
369
target_compile_definitions (CoreFoundation
349
370
PRIVATE
350
371
-D_DLL)
372
+ target_compile_definitions (CFURLSessionInterface
373
+ PRIVATE
374
+ -D_DLL)
351
375
if (BUILD_SHARED_LIBS )
352
376
target_compile_definitions (CoreFoundation
353
377
PRIVATE
354
378
-D_WINDLL)
379
+ target_compile_definitions (CFURLSessionInterface
380
+ PRIVATE
381
+ -D_WINDLL)
355
382
endif ()
356
383
target_compile_definitions (CoreFoundation
357
384
PRIVATE
358
385
-DCURL_STATICLIB)
386
+ target_compile_definitions (CFURLSessionInterface
387
+ PRIVATE
388
+ -DCURL_STATICLIB)
359
389
endif ()
360
390
target_compile_definitions (CoreFoundation
361
391
PRIVATE
362
392
-DU_SHOW_DRAFT_API
363
393
-DCF_BUILDING_CF)
394
+ target_compile_definitions (CFURLSessionInterface
395
+ PRIVATE
396
+ -DU_SHOW_DRAFT_API
397
+ -DCF_BUILDING_CF)
364
398
if (CF_DEPLOYMENT_SWIFT)
365
399
target_compile_definitions (CoreFoundation
366
400
PRIVATE
367
401
-DDEPLOYMENT_RUNTIME_SWIFT)
402
+ target_compile_definitions (CFURLSessionInterface
403
+ PRIVATE
404
+ -DDEPLOYMENT_RUNTIME_SWIFT)
368
405
else ()
369
406
target_compile_definitions (CoreFoundation
370
407
PRIVATE
371
408
-DDEPLOYMENT_RUNTIME_C)
409
+ target_compile_definitions (CFURLSessionInterface
410
+ PRIVATE
411
+ -DDEPLOYMENT_RUNTIME_C)
372
412
endif ()
373
413
target_compile_definitions (CoreFoundation
374
414
PRIVATE
@@ -386,7 +426,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
386
426
PRIVATE
387
427
${LIBXML2_INCLUDE_DIR} )
388
428
find_package (CURL REQUIRED)
389
- target_include_directories (CoreFoundation
429
+ target_include_directories (CFURLSessionInterface
390
430
PRIVATE
391
431
${CURL_INCLUDE_DIRS} )
392
432
find_package (ICU COMPONENTS uc i18n REQUIRED)
@@ -398,27 +438,44 @@ target_include_directories(CoreFoundation
398
438
PRIVATE
399
439
${CF_PATH_TO_LIBDISPATCH_SOURCE}
400
440
${CF_PATH_TO_LIBDISPATCH_BUILD} /tests)
441
+ target_include_directories (CFURLSessionInterface
442
+ PRIVATE
443
+ ${CF_PATH_TO_LIBDISPATCH_SOURCE}
444
+ ${CF_PATH_TO_LIBDISPATCH_BUILD} /tests)
401
445
if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
402
446
target_include_directories (CoreFoundation
403
447
SYSTEM PRIVATE
404
448
${CF_PATH_TO_LIBDISPATCH_SOURCE} /src/BlocksRuntime)
449
+ target_include_directories (CFURLSessionInterface
450
+ SYSTEM PRIVATE
451
+ ${CF_PATH_TO_LIBDISPATCH_SOURCE} /src/BlocksRuntime)
405
452
endif ()
406
453
407
454
if ("${CMAKE_C_SIMULATE_ID} " STREQUAL "MSVC" )
408
455
target_compile_options (CoreFoundation
409
456
PRIVATE
410
457
$<$<COMPILE_LANGUAGE:C>:/FI${PROJECT_SOURCE_DIR} /Base.subproj/CoreFoundation_Prefix.h>)
458
+ target_compile_options (CFURLSessionInterface
459
+ PRIVATE
460
+ $<$<COMPILE_LANGUAGE:C>:/FI${PROJECT_SOURCE_DIR} /Base.subproj/CoreFoundation_Prefix.h>)
411
461
else ()
412
462
target_compile_options (CoreFoundation
413
463
PRIVATE
414
464
$<$<COMPILE_LANGUAGE:C>:-include ;${PROJECT_SOURCE_DIR} /Base.subproj/CoreFoundation_Prefix.h>)
465
+ target_compile_options (CFURLSessionInterface
466
+ PRIVATE
467
+ $<$<COMPILE_LANGUAGE:C>:-include ;${PROJECT_SOURCE_DIR} /Base.subproj/CoreFoundation_Prefix.h>)
415
468
endif ()
416
469
417
470
if ("${CMAKE_C_SIMULATE_ID} " STREQUAL "MSVC" )
418
471
target_compile_options (CoreFoundation
419
472
PRIVATE
420
473
-fblocks
421
474
/EHsc)
475
+ target_compile_options (CFURLSessionInterface
476
+ PRIVATE
477
+ -fblocks
478
+ /EHsc)
422
479
else ()
423
480
target_compile_options (CoreFoundation
424
481
PRIVATE
@@ -427,16 +484,29 @@ else()
427
484
-fdollars-in-identifiers
428
485
-fexceptions
429
486
-fno-common)
487
+ target_compile_options (CFURLSessionInterface
488
+ PRIVATE
489
+ -fblocks
490
+ -fconstant-cfstrings
491
+ -fdollars-in-identifiers
492
+ -fexceptions
493
+ -fno-common)
430
494
endif ()
431
495
if (CF_DEPLOYMENT_SWIFT)
432
496
if ("${CMAKE_C_SIMULATE_ID} " STREQUAL "MSVC" )
433
497
target_compile_options (CoreFoundation
434
498
PRIVATE
435
499
/clang:-fcf-runtime-abi=swift)
500
+ target_compile_options (CFURLSessionInterface
501
+ PRIVATE
502
+ /clang:-fcf-runtime-abi=swift)
436
503
else ()
437
504
target_compile_options (CoreFoundation
438
505
PRIVATE
439
506
-fcf-runtime-abi=swift)
507
+ target_compile_options (CFURLSessionInterface
508
+ PRIVATE
509
+ -fcf-runtime-abi=swift)
440
510
endif ()
441
511
endif ()
442
512
@@ -450,12 +520,24 @@ target_compile_options(CoreFoundation
450
520
-Wno-int-conversion
451
521
-Wno-unused-function
452
522
-Wno-microsoft-enum-forward-reference)
523
+ target_compile_options (CFURLSessionInterface
524
+ PRIVATE
525
+ -Wno-shorten-64-to-32
526
+ -Wno-deprecated-declarations
527
+ -Wno-unreachable-code
528
+ -Wno-conditional-uninitialized
529
+ -Wno-unused-variable
530
+ -Wno-int-conversion
531
+ -Wno-unused-function
532
+ -Wno-microsoft-enum-forward-reference)
453
533
454
534
if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
455
535
target_link_libraries (CoreFoundation
456
536
PRIVATE
457
- ${CURL_LIBRARIES}
458
537
${LIBXML2_LIBRARIES} )
538
+ target_link_libraries (CFURLSessionInterface
539
+ PRIVATE
540
+ ${CURL_LIBRARIES} )
459
541
endif ()
460
542
if (CMAKE_SYSTEM_NAME STREQUAL Android)
461
543
target_link_libraries (CoreFoundation
@@ -473,26 +555,42 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
473
555
Secur32
474
556
User32
475
557
mincore)
558
+ target_link_libraries (CFURLSessionInterface
559
+ PRIVATE
560
+ AdvAPI32
561
+ Secur32
562
+ User32
563
+ mincore)
476
564
endif ()
477
565
if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
478
566
target_link_libraries (CoreFoundation
479
567
PRIVATE
480
568
m)
569
+ target_link_libraries (CFURLSessionInterface
570
+ PRIVATE
571
+ m)
481
572
endif ()
482
573
target_link_libraries (CoreFoundation
483
574
PRIVATE
484
575
dispatch)
576
+ target_link_libraries (CFURLSessionInterface
577
+ PRIVATE
578
+ dispatch)
485
579
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
486
580
target_link_libraries (CoreFoundation
487
581
PRIVATE
488
582
icucore)
583
+ target_link_libraries (CFURLSessionInterface
584
+ PRIVATE
585
+ icucore)
489
586
set_target_properties (CoreFoundation
490
587
PROPERTIES LINK_FLAGS
491
588
-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)
492
589
endif ()
493
590
494
591
install (TARGETS
495
592
CoreFoundation
593
+ CFURLSessionInterface
496
594
DESTINATION
497
595
"${CMAKE_INSTALL_FULL_LIBDIR} " )
498
596
install (DIRECTORY
0 commit comments