summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorKevin Puetz <PuetzKevinA@JohnDeere.com>2017-04-28 16:13:06 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-16 14:21:22 (GMT)
commitb554caf75331ef8f185cdd8c7e7b5672acd8e6d7 (patch)
treeccda734eddb950d5bd575e8cbfdcd389399c5088 /Source/cmGlobalNinjaGenerator.cxx
parent471779764757a3a6e4b5fb1db9b8943630b18f3d (diff)
downloadCMake-b554caf75331ef8f185cdd8c7e7b5672acd8e6d7.zip
CMake-b554caf75331ef8f185cdd8c7e7b5672acd8e6d7.tar.gz
CMake-b554caf75331ef8f185cdd8c7e7b5672acd8e6d7.tar.bz2
Ninja: List compile_commands.json as generated by CMake
This fixes a false-positive `CMP0058` warning if any custom rules depend on `compile_commands.json` (e.g. to trigger rerunning clang-tooling utilities). Fixes: #16444
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index d9a8cab..88fcb12 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -898,6 +898,10 @@ void cmGlobalNinjaGenerator::AddCXXCompileCommand(
this->GetCMakeInstance()->GetHomeOutputDirectory();
if (!this->CompileCommandsStream) {
std::string buildFilePath = buildFileDir + "/compile_commands.json";
+ if (this->ComputingUnknownDependencies) {
+ this->CombinedBuildOutputs.insert(
+ this->NinjaOutputPath("compile_commands.json"));
+ }
// Get a stream where to generate things.
this->CompileCommandsStream =