File tree Expand file tree Collapse file tree 3 files changed +22
-11
lines changed Expand file tree Collapse file tree 3 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
39
39
40
40
option (BUILD_SHARED_LIBS "build shared libraries" ON )
41
41
option (HAS_LIBDISPATCH_API "has libdispatch API" ON )
42
- option (BUILD_NETWORKING "build FoundationNetworking module" ON )
42
+ option (FOUNDATION_ENABLE_FOUNDATION_NETWORKING "build FoundationNetworking module" ON )
43
43
option (BUILD_TOOLS "build tools" ON )
44
44
option (NS_CURL_ASSUME_FEATURES_MISSING "Assume that optional libcurl features are missing rather than test the library's version, for build debugging" NO )
45
45
@@ -101,7 +101,7 @@ if(NOT BUILD_SHARED_LIBS)
101
101
install (TARGETS CoreFoundation CFXMLInterface
102
102
DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}> )
103
103
104
- if (BUILD_NETWORKING )
104
+ if (FOUNDATION_ENABLE_FOUNDATION_NETWORKING )
105
105
set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS
106
106
CFURLSessionInterface )
107
107
install (TARGETS CFURLSessionInterface
Original file line number Diff line number Diff line change @@ -26,11 +26,14 @@ find_package(Threads REQUIRED)
26
26
27
27
if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
28
28
find_package (LibXml2 REQUIRED )
29
- find_package (CURL CONFIG )
30
- if (CURL_FOUND )
31
- set (CURL_VERSION_STRING ${CURL_VERSION} )
32
- else ()
33
- find_package (CURL REQUIRED )
29
+
30
+ if (FOUNDATION_ENABLE_FOUNDATION_NETWORKING )
31
+ find_package (CURL CONFIG )
32
+ if (CURL_FOUND )
33
+ set (CURL_VERSION_STRING ${CURL_VERSION} )
34
+ else ()
35
+ find_package (CURL REQUIRED )
36
+ endif ()
34
37
endif ()
35
38
endif ()
36
39
@@ -431,7 +434,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
431
434
PRIVATE
432
435
CURL_STATICLIB )
433
436
endif ()
434
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
437
+ if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin AND FOUNDATION_ENABLE_FOUNDATION_NETWORKING )
435
438
target_link_libraries (CFURLSessionInterface PRIVATE
436
439
CURL::libcurl )
437
440
endif ()
@@ -530,10 +533,16 @@ endif()
530
533
531
534
install (TARGETS
532
535
CoreFoundation
533
- CFURLSessionInterface
534
536
CFXMLInterface
535
537
DESTINATION
536
- "${CMAKE_INSTALL_FULL_LIBDIR} " )
538
+ "${CMAKE_INSTALL_FULL_LIBDIR} /$<LOWER_CASE:${CMAKE_SYSTEM_NAME} >" )
539
+
540
+ if (FOUNDATION_ENABLE_FOUNDATION_NETWORKING )
541
+ install (TARGETS
542
+ CFURLSessionInterface
543
+ DESTINATION
544
+ "${CMAKE_INSTALL_FULL_LIBDIR} /$<LOWER_CASE:${CMAKE_SYSTEM_NAME} >" )
545
+ endif ()
537
546
538
547
# Needed to avoid double slash "//" when CMAKE_INSTALL_PREFIX set to "/" and DESTDIR used to relocate whole installation.
539
548
# Double slash raise CMake error "file called with network path DESTINATION //System/Library/Frameworks".
Original file line number Diff line number Diff line change 1
1
add_subdirectory (UUID )
2
2
add_subdirectory (Foundation )
3
- add_subdirectory (FoundationNetworking )
3
+ if (FOUNDATION_ENABLE_FOUNDATION_NETWORKING )
4
+ add_subdirectory (FoundationNetworking )
5
+ endif ()
4
6
add_subdirectory (FoundationXML )
5
7
add_subdirectory (Tools )
You can’t perform that action at this time.
0 commit comments