From 56178cd97c335a44317c297cce26a8d15692632e Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Tue, 12 Aug 2025 14:57:33 +0100 Subject: [PATCH] [xcodegen] Allow absolute path for output in compile commands Looks like in newer versions of CMake this can be an absolute path. --- .../SwiftXcodeGen/BuildArgs/ClangBuildArgsProvider.swift | 2 +- .../Sources/SwiftXcodeGen/Command/CompileCommands.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/swift-xcodegen/Sources/SwiftXcodeGen/BuildArgs/ClangBuildArgsProvider.swift b/utils/swift-xcodegen/Sources/SwiftXcodeGen/BuildArgs/ClangBuildArgsProvider.swift index a226e59499a83..4d9075406ca64 100644 --- a/utils/swift-xcodegen/Sources/SwiftXcodeGen/BuildArgs/ClangBuildArgsProvider.swift +++ b/utils/swift-xcodegen/Sources/SwiftXcodeGen/BuildArgs/ClangBuildArgsProvider.swift @@ -42,7 +42,7 @@ struct ClangBuildArgsProvider { else { continue } - let output = command.output.map { command.directory.appending($0) } + let output = command.output.map { $0.absolute(in: command.directory) } if let existing = commandsToAdd[relFilePath], let existingOutput = existing.output, output == nil || existingOutput.exists || !output!.exists { diff --git a/utils/swift-xcodegen/Sources/SwiftXcodeGen/Command/CompileCommands.swift b/utils/swift-xcodegen/Sources/SwiftXcodeGen/Command/CompileCommands.swift index 64b04c73a81c4..09c84e442fb96 100644 --- a/utils/swift-xcodegen/Sources/SwiftXcodeGen/Command/CompileCommands.swift +++ b/utils/swift-xcodegen/Sources/SwiftXcodeGen/Command/CompileCommands.swift @@ -27,7 +27,7 @@ extension CompileCommands { struct Element: Decodable { var directory: AbsolutePath var file: AbsolutePath - var output: RelativePath? + var output: AnyPath? var command: Command } }