diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-07-15 19:29:20 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2022-07-15 20:22:21 (GMT) |
commit | a186c1aff61fdedd2ef8d544c9f31c739daaa896 (patch) | |
tree | d4d3ec2624cf461de21d6f6d6c5695459c808f7a /Source/cmNinjaTargetGenerator.cxx | |
parent | cc803ce68049925afff405c3dad6fd4e4559a005 (diff) | |
download | CMake-a186c1aff61fdedd2ef8d544c9f31c739daaa896.zip CMake-a186c1aff61fdedd2ef8d544c9f31c739daaa896.tar.gz CMake-a186c1aff61fdedd2ef8d544c9f31c739daaa896.tar.bz2 |
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
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 86ae45d..a4080d8 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -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) { |