Ninja Multi-Config: Deduplicate compile_commands.json for cross configs

compile_commands.json was being written for every permutation of
cross configurations. Deduplicate so only one command is output
for each configuration.

Fixes: #23733
This commit is contained in:
Kyle Edwards
2022-07-15 15:29:20 -04:00
parent cc803ce680
commit a186c1aff6
4 changed files with 41 additions and 3 deletions
+5 -3
View File
@@ -1343,9 +1343,11 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
}
}
this->ExportObjectCompileCommand(
language, sourceFilePath, objectDir, objectFileName, objectFileDir,
vars["FLAGS"], vars["DEFINES"], vars["INCLUDES"], config);
if (firstForConfig) {
this->ExportObjectCompileCommand(
language, sourceFilePath, objectDir, objectFileName, objectFileDir,
vars["FLAGS"], vars["DEFINES"], vars["INCLUDES"], config);
}
objBuild.Outputs.push_back(objectFileName);
if (firstForConfig) {