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 (FOUNDATION_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
@@ -103,7 +103,7 @@ if(NOT BUILD_SHARED_LIBS)
103
103
install (TARGETS CoreFoundation CFXMLInterface
104
104
DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME} >)
105
105
106
- if (BUILD_NETWORKING )
106
+ if (FOUNDATION_ENABLE_FOUNDATION_NETWORKING )
107
107
set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS
108
108
CFURLSessionInterface)
109
109
install (TARGETS CFURLSessionInterface
Original file line number Diff line number Diff line change @@ -28,11 +28,14 @@ endif()
28
28
29
29
if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
30
30
find_package (LibXml2 REQUIRED)
31
- find_package (CURL CONFIG)
32
- if (CURL_FOUND)
33
- set (CURL_VERSION_STRING ${CURL_VERSION} )
34
- else ()
35
- find_package (CURL REQUIRED)
31
+
32
+ if (FOUNDATION_ENABLE_FOUNDATION_NETWORKING)
33
+ find_package (CURL CONFIG)
34
+ if (CURL_FOUND)
35
+ set (CURL_VERSION_STRING ${CURL_VERSION} )
36
+ else ()
37
+ find_package (CURL REQUIRED)
38
+ endif ()
36
39
endif ()
37
40
endif ()
38
41
@@ -438,7 +441,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
438
441
PRIVATE
439
442
CURL_STATICLIB)
440
443
endif ()
441
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
444
+ if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin AND FOUNDATION_ENABLE_FOUNDATION_NETWORKING )
442
445
target_link_libraries (CFURLSessionInterface PRIVATE
443
446
CURL::libcurl)
444
447
endif ()
@@ -540,10 +543,16 @@ endif()
540
543
541
544
install (TARGETS
542
545
CoreFoundation
543
- CFURLSessionInterface
544
546
CFXMLInterface
545
547
DESTINATION
546
- "${CMAKE_INSTALL_FULL_LIBDIR} " )
548
+ "${CMAKE_INSTALL_FULL_LIBDIR} /$<LOWER_CASE:${CMAKE_SYSTEM_NAME} >" )
549
+
550
+ if (FOUNDATION_ENABLE_FOUNDATION_NETWORKING)
551
+ install (TARGETS
552
+ CFURLSessionInterface
553
+ DESTINATION
554
+ "${CMAKE_INSTALL_FULL_LIBDIR} /$<LOWER_CASE:${CMAKE_SYSTEM_NAME} >" )
555
+ endif ()
547
556
548
557
# Needed to avoid double slash "//" when CMAKE_INSTALL_PREFIX set to "/" and DESTDIR used to relocate whole installation.
549
558
# 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
if (FOUNDATION_BUILD_TOOLS)
6
8
add_subdirectory (Tools)
You can’t perform that action at this time.
0 commit comments