Skip to content

Commit 24cb3bb

Browse files
committed
Restructure FoundationNetworking into Sources/FoundationNetworking
This moves the resources for the FoundationNetworking target into `Sources` into their own subdirectory. This sorts the sources for the target from the rest of the Foundation trget after the split into sub-modules.
1 parent 6db5769 commit 24cb3bb

32 files changed

+57
-49
lines changed

Foundation/CMakeLists.txt

+1-49
Original file line numberDiff line numberDiff line change
@@ -175,63 +175,15 @@ set_target_properties(Foundation PROPERTIES
175175
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/swift)
176176

177177

178-
add_library(FoundationNetworking
179-
Boxing.swift
180-
NSURLRequest.swift
181-
HTTPCookie.swift
182-
HTTPCookieStorage.swift
183-
URLAuthenticationChallenge.swift
184-
URLCache.swift
185-
URLCredential.swift
186-
URLCredentialStorage.swift
187-
URLProtectionSpace.swift
188-
URLProtocol.swift
189-
URLRequest.swift
190-
URLResponse.swift
191-
URLSession/BodySource.swift
192-
URLSession/Configuration.swift
193-
URLSession/http/HTTPMessage.swift
194-
URLSession/http/HTTPURLProtocol.swift
195-
URLSession/libcurl/EasyHandle.swift
196-
URLSession/libcurl/libcurlHelpers.swift
197-
URLSession/libcurl/MultiHandle.swift
198-
URLSession/Message.swift
199-
URLSession/NativeProtocol.swift
200-
URLSession/NetworkingSpecific.swift
201-
URLSession/ftp/FTPURLProtocol.swift
202-
URLSession/TaskRegistry.swift
203-
URLSession/TransferState.swift
204-
URLSession/URLSession.swift
205-
URLSession/URLSessionConfiguration.swift
206-
URLSession/URLSessionDelegate.swift
207-
URLSession/URLSessionTask.swift)
208-
target_compile_definitions(FoundationNetworking PRIVATE
209-
DEPLOYMENT_RUNTIME_SWIFT
210-
NS_BUILDING_FOUNDATION_NETWORKING)
211-
target_compile_options(FoundationNetworking PUBLIC
212-
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
213-
if(ENABLE_TESTING)
214-
target_compile_options(FoundationNetworking PRIVATE
215-
-enable-testing)
216-
endif()
217-
target_link_libraries(FoundationNetworking PRIVATE
218-
Foundation
219-
CFURLSessionInterface)
220-
set_target_properties(FoundationNetworking PROPERTIES
221-
INSTALL_RPATH "$ORIGIN"
222-
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift
223-
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/swift)
224178

225179
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS
226180
Foundation FoundationNetworking)
227181
get_swift_host_arch(swift_arch)
228-
install(TARGETS Foundation FoundationNetworking
182+
install(TARGETS Foundation
229183
ARCHIVE DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
230184
LIBRARY DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
231185
RUNTIME DESTINATION bin)
232186
install(FILES
233187
${CMAKE_BINARY_DIR}/swift/Foundation.swiftdoc
234188
${CMAKE_BINARY_DIR}/swift/Foundation.swiftmodule
235-
${CMAKE_BINARY_DIR}/swift/FoundationNetworking.swiftdoc
236-
${CMAKE_BINARY_DIR}/swift/FoundationNetworking.swiftmodule
237189
DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch})

Sources/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
add_subdirectory(UUID)
2+
add_subdirectory(FoundationNetworking)
23
add_subdirectory(FoundationXML)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
add_library(FoundationNetworking
2+
../../Foundation/Boxing.swift
3+
HTTPCookie.swift
4+
HTTPCookieStorage.swift
5+
NSURLRequest.swift
6+
URLAuthenticationChallenge.swift
7+
URLCache.swift
8+
URLCredential.swift
9+
URLCredentialStorage.swift
10+
URLProtectionSpace.swift
11+
URLProtocol.swift
12+
URLRequest.swift
13+
URLResponse.swift
14+
URLSession/BodySource.swift
15+
URLSession/Configuration.swift
16+
URLSession/FTP/FTPURLProtocol.swift
17+
URLSession/HTTP/HTTPMessage.swift
18+
URLSession/HTTP/HTTPURLProtocol.swift
19+
URLSession/Message.swift
20+
URLSession/NativeProtocol.swift
21+
URLSession/NetworkingSpecific.swift
22+
URLSession/TaskRegistry.swift
23+
URLSession/TransferState.swift
24+
URLSession/URLSession.swift
25+
URLSession/URLSessionConfiguration.swift
26+
URLSession/URLSessionDelegate.swift
27+
URLSession/URLSessionTask.swift
28+
URLSession/libcurl/EasyHandle.swift
29+
URLSession/libcurl/MultiHandle.swift
30+
URLSession/libcurl/libcurlHelpers.swift)
31+
target_compile_definitions(FoundationNetworking PRIVATE
32+
DEPLOYMENT_RUNTIME_SWIFT
33+
NS_BUILDING_FOUNDATION_NETWORKING)
34+
target_compile_options(FoundationNetworking PUBLIC
35+
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
36+
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
37+
target_link_libraries(FoundationNetworking PRIVATE
38+
Foundation
39+
CFURLSessionInterface)
40+
set_target_properties(FoundationNetworking PROPERTIES
41+
INSTALL_RPATH "$ORIGIN"
42+
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift
43+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/swift)
44+
45+
46+
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationNetworking)
47+
install(TARGETS FoundationNetworking
48+
ARCHIVE DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
49+
LIBRARY DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
50+
RUNTIME DESTINATION bin)
51+
get_swift_host_arch(swift_arch)
52+
install(FILES
53+
${CMAKE_BINARY_DIR}/swift/FoundationNetworking.swiftdoc
54+
${CMAKE_BINARY_DIR}/swift/FoundationNetworking.swiftmodule
55+
DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)