Skip to content

Commit 9ecff9d

Browse files
Merge pull request #596 from ian-twilightcoder/swift-api-digester-system-paths
Use -Isystem and -Fsystem for swift-api-digester
2 parents f70c3e9 + 1757341 commit 9ecff9d

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ public final class SwiftABICheckerToolSpec : GenericCommandLineToolSpec, SpecIde
105105
for searchPath in SwiftCompilerSpec.collectInputSearchPaths(cbc, toolInfo: toolSpecInfo) {
106106
commandLine += ["-I", searchPath]
107107
}
108-
// swift-api-digester doesn't support -Isystem or -Fsystem.
109-
commandLine += cbc.scope.evaluate(BuiltinMacros.SWIFT_SYSTEM_INCLUDE_PATHS).flatMap { ["-I", $0] }
110-
commandLine += cbc.scope.evaluate(BuiltinMacros.SYSTEM_FRAMEWORK_SEARCH_PATHS).flatMap { ["-F", $0] }
111108
delegate.createTask(type: self,
112109
payload: ABICheckerPayload(
113110
serializedDiagnosticsPath: serializedDiagsPath,

Sources/SWBCore/SpecImplementations/Tools/SwiftABIGenerationTool.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,10 @@ public final class SwiftABIGenerationToolSpec : GenericCommandLineToolSpec, Spec
4949

5050
var commandLine = await commandLineFromTemplate(cbc, delegate, optionContext: discoveredCommandLineToolSpecInfo(cbc.producer, cbc.scope, delegate)).map(\.asString)
5151
commandLine += ["-o", baselineFile.normalize().str]
52-
// swift-api-digester doesn't support -Fsystem or -Isystem.
53-
commandLine += cbc.scope.evaluate(BuiltinMacros.SYSTEM_FRAMEWORK_SEARCH_PATHS).flatMap { ["-F", $0] }
5452
// Add import search paths
5553
for searchPath in SwiftCompilerSpec.collectInputSearchPaths(cbc, toolInfo: toolSpecInfo) {
5654
commandLine += ["-I", searchPath]
5755
}
58-
commandLine += cbc.scope.evaluate(BuiltinMacros.SWIFT_SYSTEM_INCLUDE_PATHS).flatMap { ["-I", $0] }
5956
delegate.createTask(type: self,
6057
ruleInfo: defaultRuleInfo(cbc, delegate),
6158
commandLine: commandLine,

Sources/SWBUniversalPlatform/Specs/Swift.xcspec

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,20 @@
14271427
FlattenRecursiveSearchPathsInValue = YES;
14281428
CommandLineFlag = "-F";
14291429
},
1430+
{
1431+
Name = SYSTEM_FRAMEWORK_SEARCH_PATHS;
1432+
Type = PathList;
1433+
DefaultValue = "$(SYSTEM_FRAMEWORK_SEARCH_PATHS)";
1434+
FlattenRecursiveSearchPathsInValue = YES;
1435+
CommandLineFlag = "-Fsystem";
1436+
},
1437+
{
1438+
Name = SWIFT_SYSTEM_INCLUDE_PATHS;
1439+
Type = PathList;
1440+
DefaultValue = "$(SWIFT_SYSTEM_INCLUDE_PATHS)";
1441+
FlattenRecursiveSearchPathsInValue = YES;
1442+
CommandLineFlag = "-Isystem";
1443+
},
14301444
{
14311445
Name = SDKROOT;
14321446
Type = Path;
@@ -1493,6 +1507,20 @@
14931507
FlattenRecursiveSearchPathsInValue = YES;
14941508
CommandLineFlag = "-F";
14951509
},
1510+
{
1511+
Name = SYSTEM_FRAMEWORK_SEARCH_PATHS;
1512+
Type = PathList;
1513+
DefaultValue = "$(SYSTEM_FRAMEWORK_SEARCH_PATHS)";
1514+
FlattenRecursiveSearchPathsInValue = YES;
1515+
CommandLineFlag = "-Fsystem";
1516+
},
1517+
{
1518+
Name = SWIFT_SYSTEM_INCLUDE_PATHS;
1519+
Type = PathList;
1520+
DefaultValue = "$(SWIFT_SYSTEM_INCLUDE_PATHS)";
1521+
FlattenRecursiveSearchPathsInValue = YES;
1522+
CommandLineFlag = "-Isystem";
1523+
},
14961524
{
14971525
Name = SDKROOT;
14981526
Type = Path;

Tests/SWBTaskConstructionTests/SwiftABICheckerTaskConstructionTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ fileprivate struct SwiftABICheckerTaskConstructionTests: CoreBasedTests {
6969
"-diagnose-sdk",
7070
"-target", "\(arch)-apple-ios\(core.loadSDK(.iOS).defaultDeploymentTarget)",
7171
"-F", "/TEST/build/Debug-iphoneos",
72+
"-Fsystem", "/Target/System/Framework/Search/Path/A",
73+
"-Isystem", "/Target/System/Import/Search/Path/A",
7274
"-module", "Fwk",
7375
"-I", "/Target/Import/Search/Path/A",
74-
"-I", "/Target/System/Import/Search/Path/A",
75-
"-F", "/Target/System/Framework/Search/Path/A"
7676
])
7777
}
7878
}
@@ -125,8 +125,8 @@ fileprivate struct SwiftABICheckerTaskConstructionTests: CoreBasedTests {
125125
"swift-api-digester",
126126
"-dump-sdk", "-target", "\(arch)-apple-ios\(core.loadSDK(.iOS).defaultDeploymentTarget)",
127127
"-F", "/TEST/build/Debug-iphoneos",
128+
"-Fsystem", "/Target/System/Framework/Search/Path/A",
128129
"-module", "Fwk", "-o",
129-
"/Target/System/Framework/Search/Path/A",
130130
])
131131
// Ensure SWIFT_ABI_GENERATION_TOOL_OUTPUT_DIR is used.
132132
task.checkOutputs([

0 commit comments

Comments
 (0)