summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-11 14:33:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-11-11 14:34:17 (GMT)
commit5e3b0aa9b273cf800b6e24b8f89eea0f4930bf88 (patch)
tree70009a27684e2d69cebb5f5ba761c44f378906c2 /Source/cmGlobalNinjaGenerator.cxx
parent1379ec2ce26adc4b20515e71a17670c9ef9af73a (diff)
parentc5011399c59a1a004d19a36a58420939fd6b8670 (diff)
downloadCMake-5e3b0aa9b273cf800b6e24b8f89eea0f4930bf88.zip
CMake-5e3b0aa9b273cf800b6e24b8f89eea0f4930bf88.tar.gz
CMake-5e3b0aa9b273cf800b6e24b8f89eea0f4930bf88.tar.bz2
Merge topic 'ninja-cleandead-no-dyndep'
c5011399c5 Ninja: Avoid cleandead with dyndep bindings for Fortran module dependencies Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5490
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 12b5033..83d15ab 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -240,6 +240,12 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
}
}
+ if (build.Variables.count("dyndep") > 0) {
+ // The ninja 'cleandead' operation does not account for outputs
+ // discovered by 'dyndep' bindings. Avoid removing them.
+ this->DisableCleandead = true;
+ }
+
os << buildStr << arguments << assignments << "\n";
}
@@ -501,6 +507,7 @@ void cmGlobalNinjaGenerator::Generate()
this->InitOutputPathPrefix();
this->TargetAll = this->NinjaOutputPath("all");
this->CMakeCacheFile = this->NinjaOutputPath("CMakeCache.txt");
+ this->DisableCleandead = false;
this->PolicyCMP0058 =
this->LocalGenerators[0]->GetMakefile()->GetPolicyStatus(
@@ -581,8 +588,8 @@ void cmGlobalNinjaGenerator::CleanMetaData()
// wrote out. Ninja-Multi doesn't have a single `build.ninja` we can use that
// is the union of all generated configurations, so we can't run it reliably
// in that case.
- if (this->NinjaSupportsCleanDeadTool && expectBuildManifest &&
- !missingBuildManifest) {
+ if (this->NinjaSupportsCleanDeadTool && !this->DisableCleandead &&
+ expectBuildManifest && !missingBuildManifest) {
run_ninja_tool({ "cleandead" });
}
// The `recompact` tool loads the manifest. As above, we don't have a single