From 835c873f2fab390c177724a1e8f0d273377133bc Mon Sep 17 00:00:00 2001 From: Dario Rexin Date: Fri, 28 Jan 2022 15:06:27 -0800 Subject: [PATCH] Temporary fix for static linking on Linux When using @_implementationOnly, the dependencies do not get emited into the module files and static linking does not work. There is a proper fix in 5.6, so this is only a temporary solution for 5.5. --- Sources/FoundationNetworking/URLSession/BodySource.swift | 6 ++++++ Sources/FoundationXML/XMLParser.swift | 3 +++ 2 files changed, 9 insertions(+) diff --git a/Sources/FoundationNetworking/URLSession/BodySource.swift b/Sources/FoundationNetworking/URLSession/BodySource.swift index 4e82976391..94e579a558 100644 --- a/Sources/FoundationNetworking/URLSession/BodySource.swift +++ b/Sources/FoundationNetworking/URLSession/BodySource.swift @@ -23,7 +23,13 @@ import Foundation #endif @_implementationOnly import CoreFoundation + +#if os(Linux) +import CFURLSessionInterface +#else @_implementationOnly import CFURLSessionInterface +#endif + import Dispatch diff --git a/Sources/FoundationXML/XMLParser.swift b/Sources/FoundationXML/XMLParser.swift index befc828212..f302428cdb 100644 --- a/Sources/FoundationXML/XMLParser.swift +++ b/Sources/FoundationXML/XMLParser.swift @@ -10,6 +10,9 @@ #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) import SwiftFoundation import CFXMLInterface +#elseif os(Linux) +import Foundation +import CFXMLInterface #else import Foundation @_implementationOnly import CFXMLInterface