diff options
author | Kevin Puetz <PuetzKevinA@JohnDeere.com> | 2017-04-28 16:13:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-16 14:21:22 (GMT) |
commit | b554caf75331ef8f185cdd8c7e7b5672acd8e6d7 (patch) | |
tree | ccda734eddb950d5bd575e8cbfdcd389399c5088 /Source/cmGlobalNinjaGenerator.cxx | |
parent | 471779764757a3a6e4b5fb1db9b8943630b18f3d (diff) | |
download | CMake-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.cxx | 4 |
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 = |