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 authored and Brad King committed 2017-05-16 10:21:22 -04:00
1 parent 4717797647
commit b554caf753
1 file changed
+4
+4
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 =