mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-12 04:20:01 -05:00
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:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user