summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 35b4f91..ea66e3d 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1274,7 +1274,7 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
}
// Add target for all configs
- if (this->IsMultiConfig()) {
+ if (this->EnableCrossConfigBuild()) {
build.ExplicitDeps.clear();
for (auto const& config : configs) {
build.ExplicitDeps.push_back(this->BuildAlias(
@@ -1710,6 +1710,9 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
config));
}
for (auto const& fileConfig : configs) {
+ if (fileConfig != config && !this->EnableCrossConfigBuild()) {
+ continue;
+ }
if (this->IsMultiConfig()) {
build.Variables["FILE_ARG"] = cmStrCat(
"-f ", cmGlobalNinjaMultiGenerator::GetNinjaFilename(fileConfig));
@@ -1718,7 +1721,7 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
}
}
- if (this->IsMultiConfig()) {
+ if (this->EnableCrossConfigBuild()) {
build.Outputs.front() = this->BuildAlias(
this->NinjaOutputPath(this->GetCleanTargetName()), "all");
build.ExplicitDeps.clear();
@@ -2192,6 +2195,12 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile(
return true;
}
+bool cmGlobalNinjaGenerator::EnableCrossConfigBuild() const
+{
+ return this->IsMultiConfig() &&
+ this->Makefiles.front()->IsOn("CMAKE_NINJA_CROSS_CONFIG_ENABLE");
+}
+
int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
std::vector<std::string>::const_iterator argEnd)
{