summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-25 14:33:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-05-25 14:33:26 (GMT)
commit99ab9212f09b1ea5a2731ca972b6c00efb9e6e1d (patch)
treede00c89fb099361a6a794d775e466b4555d0e014 /Source/cmLocalNinjaGenerator.cxx
parent7612246d0f84f4b2d674344aa76f5abc60dd4cd5 (diff)
parentdddb4f02f74a2ffe550e0b2404504d657358b69a (diff)
downloadCMake-99ab9212f09b1ea5a2731ca972b6c00efb9e6e1d.zip
CMake-99ab9212f09b1ea5a2731ca972b6c00efb9e6e1d.tar.gz
CMake-99ab9212f09b1ea5a2731ca972b6c00efb9e6e1d.tar.bz2
Merge topic 'ninja-multi-install'
dddb4f02f7 Ninja Multi-Config: Make "install" targets depend on default configs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4778
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx37
1 files changed, 37 insertions, 0 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index d1944a4..e52e0d3 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -97,6 +97,43 @@ void cmLocalNinjaGenerator::Generate()
if (target->Target->IsPerConfig()) {
for (auto const& config : this->GetConfigNames()) {
tg->Generate(config);
+ if (target->GetType() == cmStateEnums::GLOBAL_TARGET &&
+ this->GetGlobalGenerator()->IsMultiConfig()) {
+ cmNinjaBuild phonyAlias("phony");
+ this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
+ target.get(), phonyAlias.Outputs, "");
+ this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
+ target.get(), phonyAlias.ExplicitDeps, config);
+ this->GetGlobalNinjaGenerator()->WriteBuild(
+ *this->GetGlobalNinjaGenerator()->GetConfigFileStream(config),
+ phonyAlias);
+ }
+ }
+ if (target->GetType() == cmStateEnums::GLOBAL_TARGET &&
+ this->GetGlobalGenerator()->IsMultiConfig()) {
+ if (!this->GetGlobalNinjaGenerator()->GetDefaultConfigs().empty()) {
+ cmNinjaBuild phonyAlias("phony");
+ this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
+ target.get(), phonyAlias.Outputs, "");
+ for (auto const& config :
+ this->GetGlobalNinjaGenerator()->GetDefaultConfigs()) {
+ this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
+ target.get(), phonyAlias.ExplicitDeps, config);
+ }
+ this->GetGlobalNinjaGenerator()->WriteBuild(
+ *this->GetGlobalNinjaGenerator()->GetDefaultFileStream(),
+ phonyAlias);
+ }
+ cmNinjaBuild phonyAlias("phony");
+ this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
+ target.get(), phonyAlias.Outputs, "all");
+ for (auto const& config : this->GetConfigNames()) {
+ this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
+ target.get(), phonyAlias.ExplicitDeps, config);
+ }
+ this->GetGlobalNinjaGenerator()->WriteBuild(
+ *this->GetGlobalNinjaGenerator()->GetDefaultFileStream(),
+ phonyAlias);
}
} else {
tg->Generate("");