3
3
4
4
import PackageDescription
5
5
6
- var dispatchIncludeFlags : CSetting
6
+ var dispatchIncludeFlags : [ CSetting ]
7
7
if let environmentPath = Context . environment [ " DISPATCH_INCLUDE_PATH " ] {
8
- dispatchIncludeFlags = . unsafeFlags( [
8
+ dispatchIncludeFlags = [ . unsafeFlags( [
9
9
" -I \( environmentPath) " ,
10
10
" -I \( environmentPath) /Block "
11
- ] )
11
+ ] ) ]
12
12
} else {
13
- dispatchIncludeFlags = . unsafeFlags( [
14
- " -I/usr/lib/swift " ,
15
- " -I/usr/lib/swift/Block "
16
- ] , . when( platforms: [ . linux, . android] ) )
13
+ dispatchIncludeFlags = [
14
+ . unsafeFlags( [
15
+ " -I/usr/lib/swift " ,
16
+ " -I/usr/lib/swift/Block "
17
+ ] , . when( platforms: [ . linux, . android] ) )
18
+ ]
19
+ if let sdkRoot = Context . environment [ " SDKROOT " ] {
20
+ dispatchIncludeFlags. append ( . unsafeFlags( [
21
+ " -I \( sdkRoot) usr \\ include " ,
22
+ " -I \( sdkRoot) usr \\ include \\ Block " ,
23
+ ] , . when( platforms: [ . windows] ) ) )
24
+ }
17
25
}
18
26
19
27
let coreFoundationBuildSettings : [ CSetting ] = [
@@ -43,9 +51,8 @@ let coreFoundationBuildSettings: [CSetting] = [
43
51
" -include " ,
44
52
" \( Context . packageDirectory) /Sources/CoreFoundation/internalInclude/CoreFoundation_Prefix.h " ,
45
53
// /EHsc for Windows
46
- ] ) ,
47
- dispatchIncludeFlags
48
- ]
54
+ ] )
55
+ ] + dispatchIncludeFlags
49
56
50
57
// For _CFURLSessionInterface, _CFXMLInterface
51
58
let interfaceBuildSettings : [ CSetting ] = [
@@ -71,9 +78,8 @@ let interfaceBuildSettings: [CSetting] = [
71
78
" -fno-common " ,
72
79
" -fcf-runtime-abi=swift "
73
80
// /EHsc for Windows
74
- ] ) ,
75
- dispatchIncludeFlags
76
- ]
81
+ ] )
82
+ ] + dispatchIncludeFlags
77
83
78
84
let swiftBuildSettings : [ SwiftSetting ] = [
79
85
. define( " DEPLOYMENT_RUNTIME_SWIFT " ) ,
0 commit comments