summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmCMakePresetsFile.cxx16
-rw-r--r--Source/cmCMakePresetsFile.h1
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx5
4 files changed, 17 insertions, 7 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 7c6d284..163224c 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 20)
-set(CMake_VERSION_PATCH 20210316)
+set(CMake_VERSION_PATCH 20210318)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/cmCMakePresetsFile.cxx b/Source/cmCMakePresetsFile.cxx
index 7726927..c73ca9a 100644
--- a/Source/cmCMakePresetsFile.cxx
+++ b/Source/cmCMakePresetsFile.cxx
@@ -1470,8 +1470,11 @@ cmCMakePresetsFile::ReadProjectPresetsInternal(bool allowNoFiles)
if (!it.second.Unexpanded.Hidden) {
const auto configurePreset =
this->ConfigurePresets.find(it.second.Unexpanded.ConfigurePreset);
- if (it.second.Unexpanded.InheritConfigureEnvironment.value_or(true) &&
- configurePreset != this->ConfigurePresets.end()) {
+ if (configurePreset == this->ConfigurePresets.end()) {
+ return ReadFileResult::INVALID_CONFIGURE_PRESET;
+ }
+
+ if (it.second.Unexpanded.InheritConfigureEnvironment.value_or(true)) {
it.second.Unexpanded.Environment.insert(
configurePreset->second.Unexpanded.Environment.begin(),
configurePreset->second.Unexpanded.Environment.end());
@@ -1487,8 +1490,11 @@ cmCMakePresetsFile::ReadProjectPresetsInternal(bool allowNoFiles)
if (!it.second.Unexpanded.Hidden) {
const auto configurePreset =
this->ConfigurePresets.find(it.second.Unexpanded.ConfigurePreset);
- if (it.second.Unexpanded.InheritConfigureEnvironment.value_or(true) &&
- configurePreset != this->ConfigurePresets.end()) {
+ if (configurePreset == this->ConfigurePresets.end()) {
+ return ReadFileResult::INVALID_CONFIGURE_PRESET;
+ }
+
+ if (it.second.Unexpanded.InheritConfigureEnvironment.value_or(true)) {
it.second.Unexpanded.Environment.insert(
configurePreset->second.Unexpanded.Environment.begin(),
configurePreset->second.Unexpanded.Environment.end());
@@ -1541,6 +1547,8 @@ const char* cmCMakePresetsFile::ResultToString(ReadFileResult result)
case ReadFileResult::BUILD_TEST_PRESETS_UNSUPPORTED:
return "File version must be 2 or higher for build and test preset "
"support.";
+ case ReadFileResult::INVALID_CONFIGURE_PRESET:
+ return "Invalid \"configurePreset\" field";
case ReadFileResult::INSTALL_PREFIX_UNSUPPORTED:
return "File version must be 3 or higher for installDir preset "
"support.";
diff --git a/Source/cmCMakePresetsFile.h b/Source/cmCMakePresetsFile.h
index eed0eab..02e6a32 100644
--- a/Source/cmCMakePresetsFile.h
+++ b/Source/cmCMakePresetsFile.h
@@ -32,6 +32,7 @@ public:
USER_PRESET_INHERITANCE,
INVALID_MACRO_EXPANSION,
BUILD_TEST_PRESETS_UNSUPPORTED,
+ INVALID_CONFIGURE_PRESET,
INSTALL_PREFIX_UNSUPPORTED,
};
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 36be45c..6937639 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -630,8 +630,9 @@ void cmGlobalNinjaGenerator::CleanMetaData()
// `build.ninja` to load for this in Ninja-Multi. This may be relaxed in the
// future pending further investigation into how Ninja works upstream
// (ninja#1721).
- if (this->NinjaSupportsUnconditionalRecompactTool && expectBuildManifest &&
- !missingBuildManifest) {
+ if (this->NinjaSupportsUnconditionalRecompactTool &&
+ !this->GetCMakeInstance()->GetRegenerateDuringBuild() &&
+ expectBuildManifest && !missingBuildManifest) {
run_ninja_tool({ "recompact" });
}
if (this->NinjaSupportsRestatTool && this->OutputPathPrefix.empty()) {