diff options
author | Brad King <brad.king@kitware.com> | 2020-11-11 14:33:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-11-11 14:34:16 (GMT) |
commit | b1208722c559920d83c571c26a382d0a158d5460 (patch) | |
tree | da93825a963fbc11c8f33223577a280d81ab773b | |
parent | 6f61b59e74b7d40d0841c1c35e7b0f1f79eee840 (diff) | |
parent | c5011399c59a1a004d19a36a58420939fd6b8670 (diff) | |
download | CMake-b1208722c559920d83c571c26a382d0a158d5460.zip CMake-b1208722c559920d83c571c26a382d0a158d5460.tar.gz CMake-b1208722c559920d83c571c26a382d0a158d5460.tar.bz2 |
Merge topic 'ninja-cleandead-no-dyndep' into release-3.19
c5011399c5 Ninja: Avoid cleandead with dyndep bindings for Fortran module dependencies
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5490
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 8c194fd..cf45da9 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 diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 884a711..a0724ac 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -545,6 +545,7 @@ private: std::string OutputPathPrefix; std::string TargetAll; std::string CMakeCacheFile; + bool DisableCleandead = false; struct ByConfig { |