Skip to content

Commit a6b2f4e

Browse files
committed
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.
1 parent 491a217 commit a6b2f4e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Sources/FoundationNetworking/URLSession/BodySource.swift

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

2525
@_implementationOnly import CoreFoundation
26+
27+
#if os(Linux)
28+
import CFURLSessionInterface
29+
#else
2630
@_implementationOnly import CFURLSessionInterface
31+
#endif
32+
2733
import Dispatch
2834

2935

Sources/FoundationXML/XMLParser.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
1111
import SwiftFoundation
1212
import CFXMLInterface
13+
#elseif os(Linux)
14+
import Foundation
15+
@_implementationOnly import CFXMLInterface
1316
#else
1417
import Foundation
1518
@_implementationOnly import CFXMLInterface

0 commit comments

Comments
 (0)