Skip to content

Commit cc29524

Browse files
committed
FIx Linux platform include CF issue
1 parent d840bbc commit cc29524

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Package.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ let development = envEnable("OPENBOX_DEVELOPMENT")
2222

2323
let releaseVersion = Context.environment["OPENBOX_TARGET_RELEASE"].flatMap { Int($0) } ?? 2024
2424

25-
let sharedCSettings: [CSetting] = []
25+
let swiftBinPath = Context.environment["_"] ?? "/usr/bin/swift"
26+
let swiftBinURL = URL(fileURLWithPath: swiftBinPath)
27+
let SDKPath = swiftBinURL.deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent().path
28+
let includePath = SDKPath.appending("/usr/lib/swift")
29+
30+
let sharedCSettings: [CSetting] = [
31+
.unsafeFlags(["-I", includePath], .when(platforms: .nonDarwinPlatforms)),
32+
.define("__COREFOUNDATION_FORSWIFTFOUNDATIONONLY__", to: "1", .when(platforms: .nonDarwinPlatforms)),
33+
]
2634
let sharedSwiftSettings: [SwiftSetting] = []
2735

2836
// MARK: - Targets
@@ -125,5 +133,3 @@ extension [Platform] {
125133
[.linux, .android, .wasi, .openbsd, .windows]
126134
}
127135
}
128-
129-

0 commit comments

Comments
 (0)