summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-28 16:31:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-02-28 16:32:07 (GMT)
commitf18c72815b78d230957b6862faf4a136edcd7b9c (patch)
tree60ece43430a314644088cff8fc45ca9614f2e865 /Source/cmGlobalNinjaGenerator.cxx
parent9afd5f0d3296194694fb05232a4da17b059b77d8 (diff)
parentc794b70f194bcff6f06971767f18473da13950e3 (diff)
downloadCMake-f18c72815b78d230957b6862faf4a136edcd7b9c.zip
CMake-f18c72815b78d230957b6862faf4a136edcd7b9c.tar.gz
CMake-f18c72815b78d230957b6862faf4a136edcd7b9c.tar.bz2
Merge topic 'ninja-multi-variable-shuffle-again'
c794b70f19 Ninja Multi-Config: Always generate build.ninja 9590c3a400 Generator: Don't allow Ninja Multi-Config variables on other generators 7a63dafafb Ninja Multi-Config: Remove "NMC" from variable names Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4403
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx30
1 files changed, 13 insertions, 17 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 12a5167..86b1e0b 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -2490,8 +2490,7 @@ bool cmGlobalNinjaMultiGenerator::OpenBuildFileStreams()
return false;
}
*this->DefaultFileStream
- << "# This file is a convenience file generated by\n"
- << "# CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG.\n\n"
+ << "# Build using rules for '" << this->DefaultFileConfig << "'.\n\n"
<< "include " << GetNinjaImplFilename(this->DefaultFileConfig) << "\n\n";
}
@@ -2608,9 +2607,6 @@ bool cmGlobalNinjaMultiGenerator::InspectConfigTypeVariables()
std::string cmGlobalNinjaMultiGenerator::GetDefaultBuildConfig() const
{
- if (this->DefaultFileConfig.empty()) {
- return "Debug";
- }
return "";
}
@@ -2626,12 +2622,14 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
std::set<std::string> configs(configsVec.cbegin(), configsVec.cend());
this->DefaultFileConfig =
- state.GetSafeCacheEntryValue("CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG");
- if (!this->DefaultFileConfig.empty() &&
- !configs.count(this->DefaultFileConfig)) {
+ state.GetSafeCacheEntryValue("CMAKE_DEFAULT_BUILD_TYPE");
+ if (this->DefaultFileConfig.empty()) {
+ this->DefaultFileConfig = configsVec.front();
+ }
+ if (!configs.count(this->DefaultFileConfig)) {
std::ostringstream msg;
msg << "The configuration specified by "
- << "CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG (" << this->DefaultFileConfig
+ << "CMAKE_DEFAULT_BUILD_TYPE (" << this->DefaultFileConfig
<< ") is not present in CMAKE_CONFIGURATION_TYPES";
this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
msg.str());
@@ -2639,12 +2637,12 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
}
std::vector<std::string> crossConfigsVec;
- cmExpandList(state.GetSafeCacheEntryValue("CMAKE_NMC_CROSS_CONFIGS"),
+ cmExpandList(state.GetSafeCacheEntryValue("CMAKE_CROSS_CONFIGS"),
crossConfigsVec);
auto crossConfigs = ListSubsetWithAll(configs, configs, crossConfigsVec);
if (!crossConfigs) {
std::ostringstream msg;
- msg << "CMAKE_NMC_CROSS_CONFIGS is not a subset of "
+ msg << "CMAKE_CROSS_CONFIGS is not a subset of "
<< "CMAKE_CONFIGURATION_TYPES";
this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
msg.str());
@@ -2653,7 +2651,7 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
this->CrossConfigs = *crossConfigs;
auto defaultConfigsString =
- state.GetSafeCacheEntryValue("CMAKE_NMC_DEFAULT_CONFIGS");
+ state.GetSafeCacheEntryValue("CMAKE_DEFAULT_CONFIGS");
if (defaultConfigsString.empty()) {
defaultConfigsString = this->DefaultFileConfig;
}
@@ -2661,9 +2659,8 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
defaultConfigsString != this->DefaultFileConfig &&
(this->DefaultFileConfig.empty() || this->CrossConfigs.empty())) {
std::ostringstream msg;
- msg << "CMAKE_NMC_DEFAULT_CONFIGS cannot be used without "
- << "CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG or "
- << "CMAKE_NMC_CROSS_CONFIGS";
+ msg << "CMAKE_DEFAULT_CONFIGS cannot be used without "
+ << "CMAKE_DEFAULT_BUILD_TYPE or CMAKE_CROSS_CONFIGS";
this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
msg.str());
return false;
@@ -2677,8 +2674,7 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
this->CrossConfigs, defaultConfigsVec);
if (!defaultConfigs) {
std::ostringstream msg;
- msg << "CMAKE_NMC_DEFAULT_CONFIGS is not a subset of "
- << "CMAKE_NMC_CROSS_CONFIGS";
+ msg << "CMAKE_DEFAULT_CONFIGS is not a subset of CMAKE_CROSS_CONFIGS";
this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
msg.str());
return false;