diff options
author | Brad King <brad.king@kitware.com> | 2020-01-13 15:34:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-13 15:34:18 (GMT) |
commit | 041e58d195587ddc9aa6d87148ea9c3ab63310d1 (patch) | |
tree | 47b02da5df58b99df0e49872ccce4c1252b84774 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 320ad3f31f7184e82e6fe38afa69d0066d796788 (diff) | |
parent | e8032e202e23436cc4301b7ded23c3fdce1161b2 (diff) | |
download | CMake-041e58d195587ddc9aa6d87148ea9c3ab63310d1.zip CMake-041e58d195587ddc9aa6d87148ea9c3ab63310d1.tar.gz CMake-041e58d195587ddc9aa6d87148ea9c3ab63310d1.tar.bz2 |
Merge topic 'ninja-cross-build-disable'
e8032e202e Ninja Multi-Config: Make cross-config building opt-in
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4205
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 360ef3c..517241e 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -72,6 +72,10 @@ void cmNinjaNormalTargetGenerator::Generate(const std::string& config) // Write the build statements bool firstForConfig = true; for (auto const& fileConfig : this->GetConfigNames()) { + if (fileConfig != config && + !this->GetGlobalGenerator()->EnableCrossConfigBuild()) { + continue; + } this->WriteObjectBuildStatements(config, fileConfig, firstForConfig); firstForConfig = false; } @@ -84,12 +88,18 @@ void cmNinjaNormalTargetGenerator::Generate(const std::string& config) this->WriteDeviceLinkStatement(config); firstForConfig = true; for (auto const& fileConfig : this->GetConfigNames()) { + if (fileConfig != config && + !this->GetGlobalGenerator()->EnableCrossConfigBuild()) { + continue; + } this->WriteLinkStatement(config, fileConfig, firstForConfig); firstForConfig = false; } } - this->GetGlobalGenerator()->AddTargetAlias( - this->GetTargetName(), this->GetGeneratorTarget(), "all"); + if (this->GetGlobalGenerator()->EnableCrossConfigBuild()) { + this->GetGlobalGenerator()->AddTargetAlias( + this->GetTargetName(), this->GetGeneratorTarget(), "all"); + } // Find ADDITIONAL_CLEAN_FILES this->AdditionalCleanFiles(config); |