Interpret the -index-store-path relative to the command’s directory

Fixes #1856
rdar://141004197
This commit is contained in:
Alex Hoppen
2024-12-13 18:34:58 +01:00
parent ec461d68d6
commit b07044d25d
2 changed files with 23 additions and 1 deletions

View File

@@ -99,7 +99,10 @@ package actor CompilationDatabaseBuildSystem: BuiltInBuildSystem {
let args = command.commandLine
for i in args.indices.reversed() {
if args[i] == "-index-store-path" && i + 1 < args.count {
return URL(fileURLWithPath: args[i + 1])
return URL(
fileURLWithPath: args[i + 1],
relativeTo: URL(fileURLWithPath: command.directory, isDirectory: true)
)
}
}
}