summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmGeneratorTarget.cxx14
-rw-r--r--Source/cmGeneratorTarget.h7
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx3
-rw-r--r--Source/cmMakefile.cxx23
-rw-r--r--Source/cmProjectCommand.cxx4
6 files changed, 39 insertions, 14 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 6e24a61..7542fa1 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,7 +2,7 @@
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 21)
set(CMake_VERSION_PATCH 0)
-set(CMake_VERSION_RC 1)
+set(CMake_VERSION_RC 2)
set(CMake_VERSION_IS_DIRTY 0)
# Start with the full version number used in tags. It has no dev info.
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index f268c6c..f1ef130 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -6346,11 +6346,11 @@ bool cmGeneratorTarget::IsLinkLookupScope(std::string const& n,
}
cm::optional<cmLinkItem> cmGeneratorTarget::LookupLinkItem(
- std::string const& n, cmListFileBacktrace const& bt) const
+ std::string const& n, cmListFileBacktrace const& bt,
+ LookupLinkItemScope* scope) const
{
cm::optional<cmLinkItem> maybeItem;
- cmLocalGenerator const* lg = this->LocalGenerator;
- if (this->IsLinkLookupScope(n, lg)) {
+ if (this->IsLinkLookupScope(n, scope->LG)) {
return maybeItem;
}
@@ -6358,7 +6358,7 @@ cm::optional<cmLinkItem> cmGeneratorTarget::LookupLinkItem(
if (name == this->GetName() || name.empty()) {
return maybeItem;
}
- maybeItem = this->ResolveLinkItem(name, bt, lg);
+ maybeItem = this->ResolveLinkItem(name, bt, scope->LG);
return maybeItem;
}
@@ -6385,9 +6385,10 @@ void cmGeneratorTarget::ExpandLinkItems(
&dagChecker, this, headTarget->LinkerLanguage),
libs);
cmMakefile const* mf = this->LocalGenerator->GetMakefile();
+ LookupLinkItemScope scope{ this->LocalGenerator };
for (std::string const& lib : libs) {
if (cm::optional<cmLinkItem> maybeItem =
- this->LookupLinkItem(lib, cge->GetBacktrace())) {
+ this->LookupLinkItem(lib, cge->GetBacktrace(), &scope)) {
if (!maybeItem->Target) {
// Report explicitly linked object files separately.
std::string const& maybeObj = maybeItem->AsStr();
@@ -7089,9 +7090,10 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface(
iface.HadContextSensitiveCondition,
iface.HadLinkLanguageSensitiveCondition);
std::vector<std::string> deps = cmExpandedList(info->SharedDeps);
+ LookupLinkItemScope scope{ this->LocalGenerator };
for (std::string const& dep : deps) {
if (cm::optional<cmLinkItem> maybeItem =
- this->LookupLinkItem(dep, cmListFileBacktrace())) {
+ this->LookupLinkItem(dep, cmListFileBacktrace(), &scope)) {
iface.SharedDeps.emplace_back(std::move(*maybeItem));
}
}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index ed66fb1..6d2aa85 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -1042,8 +1042,13 @@ private:
bool& hadHeadSensitiveCondition,
bool& hadContextSensitiveCondition,
bool& hadLinkLanguageSensitiveCondition) const;
+ struct LookupLinkItemScope
+ {
+ cmLocalGenerator const* LG;
+ };
cm::optional<cmLinkItem> LookupLinkItem(std::string const& n,
- cmListFileBacktrace const& bt) const;
+ cmListFileBacktrace const& bt,
+ LookupLinkItemScope* scope) const;
std::vector<BT<std::string>> GetSourceFilePaths(
std::string const& config) const;
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index aafc9d5..4fab0b9 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -211,7 +211,6 @@ public:
platforms.emplace_back("Win32");
platforms.emplace_back("ARM");
platforms.emplace_back("ARM64");
- platforms.emplace_back("ARM64EC");
return platforms;
}
@@ -305,6 +304,7 @@ public:
platforms.emplace_back("Win32");
platforms.emplace_back("ARM");
platforms.emplace_back("ARM64");
+ platforms.emplace_back("ARM64EC");
return platforms;
}
@@ -369,6 +369,7 @@ public:
platforms.emplace_back("Win32");
platforms.emplace_back("ARM");
platforms.emplace_back("ARM64");
+ platforms.emplace_back("ARM64EC");
return platforms;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d2d34f9..c970abe 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1962,9 +1962,26 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
}
}
this->GetCMakeInstance()->AddCacheEntry(name, value, doc, type);
- if (this->GetPolicyStatus(cmPolicies::CMP0126) != cmPolicies::NEW) {
- // if there was a definition then remove it
- this->StateSnapshot.RemoveDefinition(name);
+ switch (this->GetPolicyStatus(cmPolicies::CMP0126)) {
+ case cmPolicies::WARN:
+ if (this->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0126") &&
+ this->IsNormalDefinitionSet(name)) {
+ this->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0126),
+ "\nFor compatibility with older versions of CMake, normal "
+ "variable \"",
+ name, "\" will be removed from the current scope."));
+ }
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ // if there was a definition then remove it
+ this->StateSnapshot.RemoveDefinition(name);
+ break;
+ case cmPolicies::NEW:
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ break;
}
}
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index acdb09f..6950c19 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -71,7 +71,7 @@ bool cmProjectCommand(std::vector<std::string> const& args,
// CMAKE_PROJECT_NAME will match PROJECT_NAME, and cmake --build
// will work.
if (!mf.GetDefinition("CMAKE_PROJECT_NAME") || mf.IsRootMakefile()) {
- mf.AddDefinition("CMAKE_PROJECT_NAME", projectName);
+ mf.RemoveDefinition("CMAKE_PROJECT_NAME");
mf.AddCacheDefinition("CMAKE_PROJECT_NAME", projectName,
"Value Computed by CMake", cmStateEnums::STATIC);
}
@@ -395,7 +395,7 @@ static void TopLevelCMakeVarCondSet(cmMakefile& mf, std::string const& name,
// in the same CMakeLists.txt file, and it is the top level
// CMakeLists.txt file, then go with the last one.
if (!mf.GetDefinition(name) || mf.IsRootMakefile()) {
- mf.AddDefinition(name, value);
+ mf.RemoveDefinition(name);
mf.AddCacheDefinition(name, value, "Value Computed by CMake",
cmStateEnums::STATIC);
}