Skip to content
Merged
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
19 changes: 15 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@

import PackageDescription

var dispatchIncludeFlags: CSetting
if let environmentPath = Context.environment["DISPATCH_INCLUDE_PATH"] {
dispatchIncludeFlags = .unsafeFlags([
"-I\(environmentPath)",
"-I\(environmentPath)/Block"
])
} else {
dispatchIncludeFlags = .unsafeFlags([
"-I/usr/lib/swift",
"-I/usr/lib/swift/Block"
], .when(platforms: [.linux, .android]))
}

let coreFoundationBuildSettings: [CSetting] = [
.headerSearchPath("internalInclude"),
.define("DEBUG", .when(configuration: .debug)),
Expand Down Expand Up @@ -30,8 +43,7 @@ let coreFoundationBuildSettings: [CSetting] = [
"\(Context.packageDirectory)/Sources/CoreFoundation/internalInclude/CoreFoundation_Prefix.h",
// /EHsc for Windows
]),
.unsafeFlags(["-I/usr/lib/swift"], .when(platforms: [.linux, .android])), // dispatch
.unsafeFlags(["-I/usr/lib/swift/Block"], .when(platforms: [.linux, .android])) // Block.h
dispatchIncludeFlags
]

// For _CFURLSessionInterface, _CFXMLInterface
Expand Down Expand Up @@ -59,8 +71,7 @@ let interfaceBuildSettings: [CSetting] = [
"-fcf-runtime-abi=swift"
// /EHsc for Windows
]),
.unsafeFlags(["-I/usr/lib/swift"], .when(platforms: [.linux, .android])), // dispatch
.unsafeFlags(["-I/usr/lib/swift/Block"], .when(platforms: [.linux, .android])) // Block.h
dispatchIncludeFlags
]

let swiftBuildSettings: [SwiftSetting] = [
Expand Down