diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-02-26 22:19:47 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-02-27 15:39:35 (GMT) |
commit | c794b70f194bcff6f06971767f18473da13950e3 (patch) | |
tree | 10882364d6d53229428bf2448ef25daf1325c75d /Source | |
parent | 9590c3a400cc16882fee860818cfdcca82e17a37 (diff) | |
download | CMake-c794b70f194bcff6f06971767f18473da13950e3.zip CMake-c794b70f194bcff6f06971767f18473da13950e3.tar.gz CMake-c794b70f194bcff6f06971767f18473da13950e3.tar.bz2 |
Ninja Multi-Config: Always generate build.ninja
If CMAKE_DEFAULT_BUILD_TYPE is not specified, use the first item
from CMAKE_CONFIGURATION_TYPES instead.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 27c28fe..5243c36 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2488,8 +2488,7 @@ bool cmGlobalNinjaMultiGenerator::OpenBuildFileStreams() return false; } *this->DefaultFileStream - << "# This file is a convenience file generated by\n" - << "# CMAKE_DEFAULT_BUILD_TYPE.\n\n" + << "# Build using rules for '" << this->DefaultFileConfig << "'.\n\n" << "include " << GetNinjaImplFilename(this->DefaultFileConfig) << "\n\n"; } @@ -2606,9 +2605,6 @@ bool cmGlobalNinjaMultiGenerator::InspectConfigTypeVariables() std::string cmGlobalNinjaMultiGenerator::GetDefaultBuildConfig() const { - if (this->DefaultFileConfig.empty()) { - return "Debug"; - } return ""; } @@ -2625,8 +2621,10 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild( this->DefaultFileConfig = state.GetSafeCacheEntryValue("CMAKE_DEFAULT_BUILD_TYPE"); - if (!this->DefaultFileConfig.empty() && - !configs.count(this->DefaultFileConfig)) { + if (this->DefaultFileConfig.empty()) { + this->DefaultFileConfig = configsVec.front(); + } + if (!configs.count(this->DefaultFileConfig)) { std::ostringstream msg; msg << "The configuration specified by " << "CMAKE_DEFAULT_BUILD_TYPE (" << this->DefaultFileConfig |