summaryrefslogtreecommitdiffstats
path: root/Source/cmState.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-10-26 19:43:57 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-10-26 19:43:57 (GMT)
commitb8937a992b956b16a9181737f695ca118c5eea49 (patch)
tree02b30e7d14f767c28e0ef69af3351f343d7bf8c9 /Source/cmState.cxx
parentd13bd6ec3d7232b4b62d3106684f4f57951f3b28 (diff)
parent9fa7afe7d332ced27264f1ef7c921aa1d95bc476 (diff)
downloadCMake-b8937a992b956b16a9181737f695ca118c5eea49.zip
CMake-b8937a992b956b16a9181737f695ca118c5eea49.tar.gz
CMake-b8937a992b956b16a9181737f695ca118c5eea49.tar.bz2
Merge branch 'release' into ninja-multi-per-config-sources
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r--Source/cmState.cxx23
1 files changed, 19 insertions, 4 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 0b6b40f..d5ac9ae 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -469,9 +469,10 @@ void cmState::AddUnexpectedCommand(std::string const& name, const char* error)
name,
[name, error](std::vector<cmListFileArgument> const&,
cmExecutionStatus& status) -> bool {
- const char* versionValue =
+ cmProp versionValue =
status.GetMakefile().GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
- if (name == "endif" && (!versionValue || atof(versionValue) <= 1.4)) {
+ if (name == "endif" &&
+ (!versionValue || atof(versionValue->c_str()) <= 1.4)) {
return true;
}
status.SetError(error);
@@ -623,8 +624,7 @@ cmProp cmState::GetGlobalProperty(const std::string& prop)
bool cmState::GetGlobalPropertyAsBool(const std::string& prop)
{
- cmProp p = this->GetGlobalProperty(prop);
- return p && cmIsOn(*p);
+ return cmIsOn(this->GetGlobalProperty(prop));
}
void cmState::SetSourceDirectory(std::string const& sourceDirectory)
@@ -837,6 +837,21 @@ cmStateSnapshot cmState::CreateBuildsystemDirectorySnapshot(
return snapshot;
}
+cmStateSnapshot cmState::CreateDeferCallSnapshot(
+ cmStateSnapshot const& originSnapshot, std::string const& fileName)
+{
+ cmStateDetail::PositionType pos =
+ this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
+ pos->SnapshotType = cmStateEnums::DeferCallType;
+ pos->Keep = false;
+ pos->ExecutionListFile = this->ExecutionListFiles.Push(
+ originSnapshot.Position->ExecutionListFile, fileName);
+ assert(originSnapshot.Position->Vars.IsValid());
+ pos->BuildSystemDirectory->DirectoryEnd = pos;
+ pos->PolicyScope = originSnapshot.Position->Policies;
+ return { this, pos };
+}
+
cmStateSnapshot cmState::CreateFunctionCallSnapshot(
cmStateSnapshot const& originSnapshot, std::string const& fileName)
{