Skip to content

Commit 2209fd2

Browse files
Merge pull request swiftlang#546 from ian-twilightcoder/SWIFT_SYSTEM_INCLUDE_PATHS
SWIFT_SYSTEM_INCLUDE_PATHS doesn't work everywhere SWIFT_INCLUDE_PATHS does
2 parents 7e6a0b8 + a6b2109 commit 2209fd2

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public final class SwiftABICheckerToolSpec : GenericCommandLineToolSpec, SpecIde
8282
for searchPath in SwiftCompilerSpec.collectInputSearchPaths(cbc, toolInfo: toolSpecInfo) {
8383
commandLine += ["-I", searchPath]
8484
}
85+
// swift-api-digester doesn't support -Isystem or -Fsystem.
86+
commandLine += cbc.scope.evaluate(BuiltinMacros.SWIFT_SYSTEM_INCLUDE_PATHS).flatMap { ["-I", $0] }
8587
commandLine += cbc.scope.evaluate(BuiltinMacros.SYSTEM_FRAMEWORK_SEARCH_PATHS).flatMap { ["-F", $0] }
8688
delegate.createTask(type: self,
8789
payload: ABICheckerPayload(serializedDiagnosticsPath: serializedDiagsPath),

Sources/SWBCore/SpecImplementations/Tools/SwiftABIGenerationTool.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ public final class SwiftABIGenerationToolSpec : GenericCommandLineToolSpec, Spec
4040

4141
var commandLine = await commandLineFromTemplate(cbc, delegate, optionContext: discoveredCommandLineToolSpecInfo(cbc.producer, cbc.scope, delegate)).map(\.asString)
4242
commandLine += ["-o", baselineFile.normalize().str]
43+
// swift-api-digester doesn't support -Fsystem or -Isystem.
4344
commandLine += cbc.scope.evaluate(BuiltinMacros.SYSTEM_FRAMEWORK_SEARCH_PATHS).flatMap { ["-F", $0] }
4445
// Add import search paths
4546
for searchPath in SwiftCompilerSpec.collectInputSearchPaths(cbc, toolInfo: toolSpecInfo) {
4647
commandLine += ["-I", searchPath]
4748
}
49+
commandLine += cbc.scope.evaluate(BuiltinMacros.SWIFT_SYSTEM_INCLUDE_PATHS).flatMap { ["-I", $0] }
4850
delegate.createTask(type: self,
4951
ruleInfo: defaultRuleInfo(cbc, delegate),
5052
commandLine: commandLine,

Tests/SWBTaskConstructionTests/SwiftABICheckerTaskConstructionTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ fileprivate struct SwiftABICheckerTaskConstructionTests: CoreBasedTests {
4040
"SWIFT_VERSION": swiftVersion,
4141
"FRAMEWORK_SEARCH_PATHS": "/Target/Framework/Search/Path/A",
4242
"SYSTEM_FRAMEWORK_SEARCH_PATHS": "/Target/System/Framework/Search/Path/A",
43+
"SWIFT_INCLUDE_PATHS": "/Target/Import/Search/Path/A",
44+
"SWIFT_SYSTEM_INCLUDE_PATHS": "/Target/System/Import/Search/Path/A",
4345
"CODE_SIGNING_ALLOWED": "NO",
4446
"BUILD_LIBRARY_FOR_DISTRIBUTION": "YES",
4547
"TAPI_EXEC": tapiToolPath.str,
@@ -68,6 +70,8 @@ fileprivate struct SwiftABICheckerTaskConstructionTests: CoreBasedTests {
6870
"-target", "\(arch)-apple-ios\(core.loadSDK(.iOS).defaultDeploymentTarget)",
6971
"-F", "/TEST/build/Debug-iphoneos",
7072
"-module", "Fwk",
73+
"-I", "/Target/Import/Search/Path/A",
74+
"-I", "/Target/System/Import/Search/Path/A",
7175
"-F", "/Target/System/Framework/Search/Path/A"
7276
])
7377
}

0 commit comments

Comments
 (0)