-
Notifications
You must be signed in to change notification settings - Fork 1.1k
FoundationNetworking: Split networking into its own module #2289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
57c012c
b3a3d01
d697422
f9d93ec
db36644
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,10 +117,12 @@ endif() | |
# be able to remove this and just use | ||
# `target_link_libraries(Foundation PRIVATE CoreFoundation)`. | ||
set(CoreFoundation_LIBRARIES $<TARGET_FILE:CoreFoundation>) | ||
set(CFURLSessionInterface_LIBRARIES $<TARGET_FILE:CFURLSessionInterface>) | ||
get_target_property(CoreFoundation_LINK_LIBRARIES CoreFoundation LINK_LIBRARIES) | ||
foreach(library ${CoreFoundation_LINK_LIBRARIES}) | ||
if(NOT library STREQUAL Threads::Threads) | ||
list(APPEND CoreFoundation_LIBRARIES -l${library}) | ||
list(APPEND CFURLSessionInterface_LIBRARIES -l${library}) | ||
endif() | ||
endforeach() | ||
|
||
|
@@ -165,8 +167,6 @@ add_swift_library(Foundation | |
Foundation/Formatter.swift | ||
Foundation/FoundationErrors.swift | ||
Foundation/Host.swift | ||
Foundation/HTTPCookie.swift | ||
Foundation/HTTPCookieStorage.swift | ||
Foundation/IndexPath.swift | ||
Foundation/IndexSet.swift | ||
Foundation/ISO8601DateFormatter.swift | ||
|
@@ -235,7 +235,6 @@ add_swift_library(Foundation | |
Foundation/NSTimeZone.swift | ||
Foundation/NSURL.swift | ||
Foundation/NSURLError.swift | ||
Foundation/NSURLRequest.swift | ||
Foundation/NSUUID.swift | ||
Foundation/NSValue.swift | ||
Foundation/NumberFormatter.swift | ||
|
@@ -264,31 +263,7 @@ add_swift_library(Foundation | |
Foundation/TimeZone.swift | ||
Foundation/Unit.swift | ||
Foundation/URL.swift | ||
Foundation/URLAuthenticationChallenge.swift | ||
Foundation/URLCache.swift | ||
Foundation/URLComponents.swift | ||
Foundation/URLCredential.swift | ||
Foundation/URLCredentialStorage.swift | ||
Foundation/URLProtectionSpace.swift | ||
Foundation/URLProtocol.swift | ||
Foundation/URLRequest.swift | ||
Foundation/URLResponse.swift | ||
Foundation/URLSession/BodySource.swift | ||
Foundation/URLSession/Configuration.swift | ||
Foundation/URLSession/http/HTTPMessage.swift | ||
Foundation/URLSession/http/HTTPURLProtocol.swift | ||
Foundation/URLSession/libcurl/EasyHandle.swift | ||
Foundation/URLSession/libcurl/libcurlHelpers.swift | ||
Foundation/URLSession/libcurl/MultiHandle.swift | ||
Foundation/URLSession/Message.swift | ||
Foundation/URLSession/NativeProtocol.swift | ||
Foundation/URLSession/ftp/FTPURLProtocol.swift | ||
Foundation/URLSession/TaskRegistry.swift | ||
Foundation/URLSession/TransferState.swift | ||
Foundation/URLSession/URLSession.swift | ||
Foundation/URLSession/URLSessionConfiguration.swift | ||
Foundation/URLSession/URLSessionDelegate.swift | ||
Foundation/URLSession/URLSessionTask.swift | ||
Foundation/UserDefaults.swift | ||
Foundation/UUID.swift | ||
Foundation/XMLDocument.swift | ||
|
@@ -303,7 +278,6 @@ add_swift_library(Foundation | |
-F${CMAKE_CURRENT_BINARY_DIR} | ||
LINK_FLAGS | ||
${CoreFoundation_LIBRARIES} | ||
${CURL_LIBRARIES} | ||
${ICU_UC_LIBRARY} ${ICU_I18N_LIBRARY} | ||
${LIBXML2_LIBRARIES} | ||
${libdispatch_ldflags} | ||
|
@@ -331,6 +305,80 @@ add_swift_library(Foundation | |
CoreFoundation | ||
$<$<PLATFORM_ID:Windows>:CoreFoundationResources>) | ||
|
||
add_swift_library(FoundationNetworking | ||
MODULE_NAME | ||
FoundationNetworking | ||
MODULE_LINK_NAME | ||
FoundationNetworking | ||
MODULE_PATH | ||
${CMAKE_CURRENT_BINARY_DIR}/swift/FoundationNetworking.swiftmodule | ||
SOURCES | ||
Foundation/Boxing.swift | ||
Foundation/NSURLRequest.swift | ||
Foundation/HTTPCookie.swift | ||
Foundation/HTTPCookieStorage.swift | ||
Foundation/URLAuthenticationChallenge.swift | ||
Foundation/URLCache.swift | ||
Foundation/URLCredential.swift | ||
Foundation/URLCredentialStorage.swift | ||
Foundation/URLProtectionSpace.swift | ||
Foundation/URLProtocol.swift | ||
Foundation/URLRequest.swift | ||
Foundation/URLResponse.swift | ||
Foundation/URLSession/BodySource.swift | ||
Foundation/URLSession/Configuration.swift | ||
Foundation/URLSession/http/HTTPMessage.swift | ||
Foundation/URLSession/http/HTTPURLProtocol.swift | ||
Foundation/URLSession/libcurl/EasyHandle.swift | ||
Foundation/URLSession/libcurl/libcurlHelpers.swift | ||
Foundation/URLSession/libcurl/MultiHandle.swift | ||
Foundation/URLSession/Message.swift | ||
Foundation/URLSession/NativeProtocol.swift | ||
Foundation/URLSession/NetworkingSpecific.swift | ||
Foundation/URLSession/ftp/FTPURLProtocol.swift | ||
Foundation/URLSession/TaskRegistry.swift | ||
Foundation/URLSession/TransferState.swift | ||
Foundation/URLSession/URLSession.swift | ||
Foundation/URLSession/URLSessionConfiguration.swift | ||
Foundation/URLSession/URLSessionDelegate.swift | ||
Foundation/URLSession/URLSessionTask.swift | ||
TARGET | ||
${CMAKE_C_COMPILER_TARGET} | ||
CFLAGS | ||
${MSVCRT_C_FLAGS} | ||
${deployment_target} | ||
${deployment_enable_libdispatch} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe that I have cleaned this up as well. This was previously needed as there was a mode for |
||
-F${CMAKE_CURRENT_BINARY_DIR} | ||
LINK_FLAGS | ||
${MSVCRT_LINK_FLAGS} | ||
-L${CMAKE_CURRENT_BINARY_DIR} | ||
${ICU_UC_LIBRARY} ${ICU_I18N_LIBRARY} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this part actually use ICU? |
||
${libdispatch_ldflags} | ||
-lFoundation | ||
${Foundation_INTERFACE_LIBRARIES} | ||
${CFURLSessionInterface_LIBRARIES} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation seems odd |
||
${CURL_LIBRARIES} | ||
${Foundation_RPATH} | ||
${WORKAROUND_SR9138} | ||
${WORKAROUND_SR9995} | ||
$<$<PLATFORM_ID:Windows>:$<TARGET_OBJECTS:CoreFoundationResources>> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need the CoreFoundationResources? That is for the TimeZone information |
||
SWIFT_FLAGS | ||
-DDEPLOYMENT_RUNTIME_SWIFT | ||
-DNS_BUILDING_FOUNDATION_NETWORKING | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation seems odd |
||
${deployment_enable_libdispatch} | ||
-I;${ICU_INCLUDE_DIR} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need ICU here? |
||
-I;${CMAKE_CURRENT_BINARY_DIR}/swift | ||
${libdispatch_cflags} | ||
${swift_enable_testing} | ||
${swift_optimization_flags} | ||
DEPENDS | ||
uuid | ||
CoreFoundation | ||
$<$<PLATFORM_ID:Windows>:CoreFoundationResources> | ||
Foundation) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation is off There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed it; I'll fix it before merge. |
||
|
||
|
||
|
||
if(NOT BUILD_SHARED_LIBS) | ||
set(Foundation_INTERFACE_LIBRARIES | ||
-L${install_dir}/usr/lib | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should no longer be needed,
deployment_target
has been removed in favour ofTARGET_OS_*
fromTargetConditionals.h