Skip to content

Avoiding linking CF from outside of Foundation #5003

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

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sources/Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ target_compile_options(Foundation PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:${_Foundation_swift_build_flags}>")

target_link_libraries(Foundation
PUBLIC
PRIVATE
CoreFoundation
PUBLIC
FoundationEssentials
FoundationInternationalization)

Expand Down
3 changes: 0 additions & 3 deletions Sources/FoundationNetworking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,13 @@ target_compile_options(FoundationNetworking PRIVATE

target_link_libraries(FoundationNetworking
PRIVATE
CoreFoundation
_CFURLSessionInterface
PUBLIC
Foundation)

if(NOT BUILD_SHARED_LIBS)
target_compile_options(FoundationNetworking PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _CFURLSessionInterface>")
target_compile_options(FoundationNetworking PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend CoreFoundation>")
target_compile_options(FoundationNetworking PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend curl>")
endif()
Expand Down
1 change: 0 additions & 1 deletion Sources/FoundationNetworking/HTTPCookieStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import SwiftFoundation
import Foundation
#endif

@_implementationOnly import CoreFoundation

/*!
@enum HTTPCookie.AcceptPolicy
Expand Down
1 change: 0 additions & 1 deletion Sources/FoundationNetworking/URLSession/BodySource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import SwiftFoundation
import Foundation
#endif

@_implementationOnly import CoreFoundation
@_implementationOnly import _CFURLSessionInterface
import Dispatch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import SwiftFoundation
import Foundation
#endif

@_implementationOnly import CoreFoundation
import Dispatch

internal class _FTPURLProtocol: _NativeProtocol {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import SwiftFoundation
#else
import Foundation
#endif
@_implementationOnly import CoreFoundation

internal extension _HTTPURLProtocol._ResponseHeaderLines {
/// Create an `NSHTTPRULResponse` from the lines.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import SwiftFoundation
import Foundation
#endif

@_implementationOnly import CoreFoundation
@_implementationOnly import _CFURLSessionInterface
import Dispatch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import SwiftFoundation
import Foundation
#endif

@_implementationOnly import CoreFoundation
import Dispatch

internal let enableLibcurlDebugOutput: Bool = {
Expand Down
1 change: 0 additions & 1 deletion Sources/FoundationNetworking/URLSession/TaskRegistry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import SwiftFoundation
import Foundation
#endif

@_implementationOnly import CoreFoundation
import Dispatch

extension URLSession {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import SwiftFoundation
#else
import Foundation
#endif
@_implementationOnly import CoreFoundation



Expand Down
1 change: 0 additions & 1 deletion Sources/FoundationNetworking/URLSession/URLSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ import SwiftFoundation
#else
import Foundation
#endif
@_implementationOnly import CoreFoundation

extension URLSession {
public enum DelayedRequestDisposition {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import SwiftFoundation
#else
import Foundation
#endif
@_implementationOnly import CoreFoundation

private class Bag<Element> {
var values: [Element] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import SwiftFoundation
#else
import Foundation
#endif
@_implementationOnly import CoreFoundation

open class URLSessionTaskMetrics : NSObject {
public internal(set) var transactionMetrics: [URLSessionTaskTransactionMetrics] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import SwiftFoundation
import Foundation
#endif

@_implementationOnly import CoreFoundation
@_implementationOnly import _CFURLSessionInterface
import Dispatch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import SwiftFoundation
import Foundation
#endif

@_implementationOnly import CoreFoundation
@_implementationOnly import _CFURLSessionInterface
import Dispatch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import SwiftFoundation
import Foundation
#endif

@_implementationOnly import CoreFoundation
@_implementationOnly import _CFURLSessionInterface
import Dispatch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
// -----------------------------------------------------------------------------


@_implementationOnly import CoreFoundation
@_implementationOnly import _CFURLSessionInterface

//TODO: Move things in this file?
Expand Down
3 changes: 0 additions & 3 deletions Sources/FoundationXML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@ target_compile_options(FoundationXML PRIVATE

target_link_libraries(FoundationXML
PRIVATE
CoreFoundation
_CFXMLInterface
PUBLIC
Foundation)

if(NOT BUILD_SHARED_LIBS)
target_compile_options(FoundationXML PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend _CFXMLInterface>")
target_compile_options(FoundationXML PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend CoreFoundation>")
target_compile_options(FoundationXML PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -public-autolink-library -Xfrontend xml2>")
endif()
Expand Down
1 change: 0 additions & 1 deletion Sources/FoundationXML/XMLDTD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import SwiftFoundation
#else
import Foundation
#endif
@_implementationOnly import CoreFoundation
@_implementationOnly import _CFXMLInterface

/*!
Expand Down
1 change: 0 additions & 1 deletion Sources/FoundationXML/XMLDTDNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import SwiftFoundation
#else
import Foundation
#endif
@_implementationOnly import CoreFoundation
@_implementationOnly import _CFXMLInterface

/*!
Expand Down
1 change: 0 additions & 1 deletion Sources/FoundationXML/XMLDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import SwiftFoundation
#else
import Foundation
#endif
@_implementationOnly import CoreFoundation
@_implementationOnly import _CFXMLInterface

// Input options
Expand Down
1 change: 0 additions & 1 deletion Sources/FoundationXML/XMLElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import SwiftFoundation
#else
import Foundation
#endif
@_implementationOnly import CoreFoundation
@_implementationOnly import _CFXMLInterface

/*!
Expand Down
1 change: 0 additions & 1 deletion Sources/FoundationXML/XMLNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import _CFXMLInterface
import Foundation
@_implementationOnly import _CFXMLInterface
#endif
@_implementationOnly import CoreFoundation

// initWithKind options
// NSXMLNodeOptionsNone
Expand Down
1 change: 0 additions & 1 deletion Sources/FoundationXML/XMLParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import _CFXMLInterface
import Foundation
@_implementationOnly import _CFXMLInterface
#endif
@_implementationOnly import CoreFoundation

extension XMLParser {
public enum ExternalEntityResolvingPolicy : UInt {
Expand Down
2 changes: 1 addition & 1 deletion Sources/_CFURLSessionInterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ add_library(_CFURLSessionInterface STATIC CFURLSessionInterface.c)
target_include_directories(_CFURLSessionInterface
PUBLIC
include
../CoreFoundation/include
PRIVATE
../CoreFoundation/internalInclude)

Expand All @@ -26,7 +27,6 @@ target_compile_options(_CFURLSessionInterface PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:C>:${_Foundation_common_build_flags}>")

target_link_libraries(_CFURLSessionInterface PRIVATE
CoreFoundation
dispatch
CURL::libcurl)

Expand Down
2 changes: 1 addition & 1 deletion Sources/_CFXMLInterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ add_library(_CFXMLInterface STATIC CFXMLInterface.c)
target_include_directories(_CFXMLInterface
PUBLIC
include
../CoreFoundation/include
PRIVATE
../CoreFoundation/internalInclude
/usr/include/libxml2/)
Expand All @@ -25,7 +26,6 @@ target_compile_options(_CFXMLInterface PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:C>:${_Foundation_common_build_flags}>")

target_link_libraries(_CFXMLInterface PRIVATE
CoreFoundation
dispatch
LibXml2::LibXml2)

Expand Down