Skip to content

Commit 082b0dc

Browse files
authored
Avoiding linking CF from outside of Foundation (#5003)
1 parent 06bd59d commit 082b0dc

26 files changed

+4
-30
lines changed

Sources/Foundation/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ target_compile_options(Foundation PRIVATE
149149
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:${_Foundation_swift_build_flags}>")
150150

151151
target_link_libraries(Foundation
152-
PUBLIC
152+
PRIVATE
153153
CoreFoundation
154+
PUBLIC
154155
FoundationEssentials
155156
FoundationInternationalization)
156157

Sources/FoundationNetworking/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,13 @@ target_compile_options(FoundationNetworking PRIVATE
5151

5252
target_link_libraries(FoundationNetworking
5353
PRIVATE
54-
CoreFoundation
5554
_CFURLSessionInterface
5655
PUBLIC
5756
Foundation)
5857

5958
if(NOT BUILD_SHARED_LIBS)
6059
target_compile_options(FoundationNetworking PRIVATE
6160
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _CFURLSessionInterface>")
62-
target_compile_options(FoundationNetworking PRIVATE
63-
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend CoreFoundation>")
6461
target_compile_options(FoundationNetworking PRIVATE
6562
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend curl>")
6663
endif()

Sources/FoundationNetworking/HTTPCookieStorage.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import SwiftFoundation
1313
import Foundation
1414
#endif
1515

16-
@_implementationOnly import CoreFoundation
1716

1817
/*!
1918
@enum HTTPCookie.AcceptPolicy

Sources/FoundationNetworking/URLSession/BodySource.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import SwiftFoundation
2222
import Foundation
2323
#endif
2424

25-
@_implementationOnly import CoreFoundation
2625
@_implementationOnly import _CFURLSessionInterface
2726
import Dispatch
2827

Sources/FoundationNetworking/URLSession/FTP/FTPURLProtocol.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import SwiftFoundation
1313
import Foundation
1414
#endif
1515

16-
@_implementationOnly import CoreFoundation
1716
import Dispatch
1817

1918
internal class _FTPURLProtocol: _NativeProtocol {

Sources/FoundationNetworking/URLSession/HTTP/HTTPMessage.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import SwiftFoundation
2222
#else
2323
import Foundation
2424
#endif
25-
@_implementationOnly import CoreFoundation
2625

2726
internal extension _HTTPURLProtocol._ResponseHeaderLines {
2827
/// Create an `NSHTTPRULResponse` from the lines.

Sources/FoundationNetworking/URLSession/HTTP/HTTPURLProtocol.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import SwiftFoundation
1313
import Foundation
1414
#endif
1515

16-
@_implementationOnly import CoreFoundation
1716
@_implementationOnly import _CFURLSessionInterface
1817
import Dispatch
1918

Sources/FoundationNetworking/URLSession/NativeProtocol.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import SwiftFoundation
2323
import Foundation
2424
#endif
2525

26-
@_implementationOnly import CoreFoundation
2726
import Dispatch
2827

2928
internal let enableLibcurlDebugOutput: Bool = {

Sources/FoundationNetworking/URLSession/TaskRegistry.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import SwiftFoundation
2222
import Foundation
2323
#endif
2424

25-
@_implementationOnly import CoreFoundation
2625
import Dispatch
2726

2827
extension URLSession {

Sources/FoundationNetworking/URLSession/TransferState.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import SwiftFoundation
2222
#else
2323
import Foundation
2424
#endif
25-
@_implementationOnly import CoreFoundation
2625

2726

2827

0 commit comments

Comments
 (0)