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
This commit is contained in:
Kevin Puetz
2017-04-28 11:13:06 -05:00
committed by Brad King
parent 4717797647
commit b554caf753

View File

@@ -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 =