[xcodegen] Allow absolute path for output in compile commands

Looks like in newer versions of CMake this can be an absolute path.
This commit is contained in:
Hamish Knight
2025-08-12 14:57:33 +01:00
parent 364dbf8553
commit 56178cd97c
2 changed files with 2 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ struct ClangBuildArgsProvider {
else { else {
continue 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], if let existing = commandsToAdd[relFilePath],
let existingOutput = existing.output, let existingOutput = existing.output,
output == nil || existingOutput.exists || !output!.exists { output == nil || existingOutput.exists || !output!.exists {

View File

@@ -27,7 +27,7 @@ extension CompileCommands {
struct Element: Decodable { struct Element: Decodable {
var directory: AbsolutePath var directory: AbsolutePath
var file: AbsolutePath var file: AbsolutePath
var output: RelativePath? var output: AnyPath?
var command: Command var command: Command
} }
} }