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)
3939
4040option (BUILD_SHARED_LIBS "build shared libraries" ON )
4141option (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 )
4343option (FOUNDATION_BUILD_TOOLS "build tools" ON )
4444option (NS_CURL_ASSUME_FEATURES_MISSING "Assume that optional libcurl features are missing rather than test the library's version, for build debugging" NO )
4545
@@ -103,7 +103,7 @@ if(NOT BUILD_SHARED_LIBS)
103103 install (TARGETS CoreFoundation CFXMLInterface
104104 DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME} >)
105105
106- if (BUILD_NETWORKING )
106+ if (FOUNDATION_ENABLE_FOUNDATION_NETWORKING )
107107 set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS
108108 CFURLSessionInterface)
109109 install (TARGETS CFURLSessionInterface
Original file line number Diff line number Diff line change @@ -28,11 +28,14 @@ endif()
2828
2929if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
3030 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 ()
3639 endif ()
3740endif ()
3841
@@ -438,7 +441,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
438441 PRIVATE
439442 CURL_STATICLIB)
440443endif ()
441- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
444+ if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin AND FOUNDATION_ENABLE_FOUNDATION_NETWORKING )
442445 target_link_libraries (CFURLSessionInterface PRIVATE
443446 CURL::libcurl)
444447endif ()
@@ -540,10 +543,16 @@ endif()
540543
541544install (TARGETS
542545 CoreFoundation
543- CFURLSessionInterface
544546 CFXMLInterface
545547 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 ()
547556
548557# Needed to avoid double slash "//" when CMAKE_INSTALL_PREFIX set to "/" and DESTDIR used to relocate whole installation.
549558# Double slash raise CMake error "file called with network path DESTINATION //System/Library/Frameworks".
Original file line number Diff line number Diff line change 11add_subdirectory (UUID)
22add_subdirectory (Foundation)
3- add_subdirectory (FoundationNetworking)
3+ if (FOUNDATION_ENABLE_FOUNDATION_NETWORKING)
4+ add_subdirectory (FoundationNetworking)
5+ endif ()
46add_subdirectory (FoundationXML)
57if (FOUNDATION_BUILD_TOOLS)
68 add_subdirectory (Tools)
You can’t perform that action at this time.
0 commit comments