diff --git a/Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift b/Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift index d3eca2b1..5fe606fd 100644 --- a/Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift +++ b/Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift @@ -82,9 +82,6 @@ public final class SwiftABICheckerToolSpec : GenericCommandLineToolSpec, SpecIde for searchPath in SwiftCompilerSpec.collectInputSearchPaths(cbc, toolInfo: toolSpecInfo) { commandLine += ["-I", searchPath] } - // swift-api-digester doesn't support -Isystem or -Fsystem. - commandLine += cbc.scope.evaluate(BuiltinMacros.SWIFT_SYSTEM_INCLUDE_PATHS).flatMap { ["-I", $0] } - commandLine += cbc.scope.evaluate(BuiltinMacros.SYSTEM_FRAMEWORK_SEARCH_PATHS).flatMap { ["-F", $0] } delegate.createTask(type: self, payload: ABICheckerPayload(serializedDiagnosticsPath: serializedDiagsPath), ruleInfo: defaultRuleInfo(cbc, delegate), diff --git a/Sources/SWBCore/SpecImplementations/Tools/SwiftABIGenerationTool.swift b/Sources/SWBCore/SpecImplementations/Tools/SwiftABIGenerationTool.swift index b407fe1b..37136080 100644 --- a/Sources/SWBCore/SpecImplementations/Tools/SwiftABIGenerationTool.swift +++ b/Sources/SWBCore/SpecImplementations/Tools/SwiftABIGenerationTool.swift @@ -40,13 +40,10 @@ public final class SwiftABIGenerationToolSpec : GenericCommandLineToolSpec, Spec var commandLine = await commandLineFromTemplate(cbc, delegate, optionContext: discoveredCommandLineToolSpecInfo(cbc.producer, cbc.scope, delegate)).map(\.asString) commandLine += ["-o", baselineFile.normalize().str] - // swift-api-digester doesn't support -Fsystem or -Isystem. - commandLine += cbc.scope.evaluate(BuiltinMacros.SYSTEM_FRAMEWORK_SEARCH_PATHS).flatMap { ["-F", $0] } // Add import search paths for searchPath in SwiftCompilerSpec.collectInputSearchPaths(cbc, toolInfo: toolSpecInfo) { commandLine += ["-I", searchPath] } - commandLine += cbc.scope.evaluate(BuiltinMacros.SWIFT_SYSTEM_INCLUDE_PATHS).flatMap { ["-I", $0] } delegate.createTask(type: self, ruleInfo: defaultRuleInfo(cbc, delegate), commandLine: commandLine, diff --git a/Sources/SWBUniversalPlatform/Specs/Swift.xcspec b/Sources/SWBUniversalPlatform/Specs/Swift.xcspec index ff751506..e26dd348 100644 --- a/Sources/SWBUniversalPlatform/Specs/Swift.xcspec +++ b/Sources/SWBUniversalPlatform/Specs/Swift.xcspec @@ -1427,6 +1427,20 @@ FlattenRecursiveSearchPathsInValue = YES; CommandLineFlag = "-F"; }, + { + Name = SYSTEM_FRAMEWORK_SEARCH_PATHS; + Type = PathList; + DefaultValue = "$(SYSTEM_FRAMEWORK_SEARCH_PATHS)"; + FlattenRecursiveSearchPathsInValue = YES; + CommandLineFlag = "-Fsystem"; + }, + { + Name = SWIFT_SYSTEM_INCLUDE_PATHS; + Type = PathList; + DefaultValue = "$(SWIFT_SYSTEM_INCLUDE_PATHS)"; + FlattenRecursiveSearchPathsInValue = YES; + CommandLineFlag = "-Isystem"; + }, { Name = SDKROOT; Type = Path; @@ -1477,6 +1491,20 @@ FlattenRecursiveSearchPathsInValue = YES; CommandLineFlag = "-F"; }, + { + Name = SYSTEM_FRAMEWORK_SEARCH_PATHS; + Type = PathList; + DefaultValue = "$(SYSTEM_FRAMEWORK_SEARCH_PATHS)"; + FlattenRecursiveSearchPathsInValue = YES; + CommandLineFlag = "-Fsystem"; + }, + { + Name = SWIFT_SYSTEM_INCLUDE_PATHS; + Type = PathList; + DefaultValue = "$(SWIFT_SYSTEM_INCLUDE_PATHS)"; + FlattenRecursiveSearchPathsInValue = YES; + CommandLineFlag = "-Isystem"; + }, { Name = SDKROOT; Type = Path; diff --git a/Tests/SWBTaskConstructionTests/SwiftABICheckerTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/SwiftABICheckerTaskConstructionTests.swift index 4f47f007..8c768400 100644 --- a/Tests/SWBTaskConstructionTests/SwiftABICheckerTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/SwiftABICheckerTaskConstructionTests.swift @@ -69,10 +69,10 @@ fileprivate struct SwiftABICheckerTaskConstructionTests: CoreBasedTests { "-diagnose-sdk", "-target", "\(arch)-apple-ios\(core.loadSDK(.iOS).defaultDeploymentTarget)", "-F", "/TEST/build/Debug-iphoneos", + "-Fsystem", "/Target/System/Framework/Search/Path/A", + "-Isystem", "/Target/System/Import/Search/Path/A", "-module", "Fwk", "-I", "/Target/Import/Search/Path/A", - "-I", "/Target/System/Import/Search/Path/A", - "-F", "/Target/System/Framework/Search/Path/A" ]) } } @@ -125,8 +125,8 @@ fileprivate struct SwiftABICheckerTaskConstructionTests: CoreBasedTests { "swift-api-digester", "-dump-sdk", "-target", "\(arch)-apple-ios\(core.loadSDK(.iOS).defaultDeploymentTarget)", "-F", "/TEST/build/Debug-iphoneos", + "-Fsystem", "/Target/System/Framework/Search/Path/A", "-module", "Fwk", "-o", - "/Target/System/Framework/Search/Path/A", ]) // Ensure SWIFT_ABI_GENERATION_TOOL_OUTPUT_DIR is used. task.checkOutputs([