summaryrefslogtreecommitdiff
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-11-01 15:27:05 +0100
committerMarc Chevrier <marc.chevrier@gmail.com>2022-02-08 00:02:32 +0100
commit42965799b4747ab1e0afa6546be13444f68c1987 (patch)
tree6149298a0fc9fd0f836cbe92b602d6eb863dc581 /Source/cmMakefile.cxx
parent78dd7d5292cef930b3d435e6901cc3b10ee02513 (diff)
downloadcmake-42965799b4747ab1e0afa6546be13444f68c1987.tar.gz
Genex: Add $<LINK_LIBRARY:...>
This generator expression offers the capability, for the link step, to decorate libraries with prefix/suffix flags and/or adding any specific flag for each library. Fixes: #22812, #18751, #20078, #22703
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4b1635b6ae..6b17cc9c74 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3976,6 +3976,31 @@ std::vector<std::string> cmMakefile::GetPropertyKeys() const
return this->StateSnapshot.GetDirectory().GetPropertyKeys();
}
+void cmMakefile::CheckProperty(const std::string& prop) const
+{
+ // Certain properties need checking.
+ if (prop == "LINK_LIBRARIES") {
+ if (cmValue value = this->GetProperty(prop)) {
+ // Look for <LINK_LIBRARY:> internal pattern
+ static cmsys::RegularExpression linkLibrary(
+ "(^|;)(</?LINK_LIBRARY:[^;>]*>)(;|$)");
+ if (!linkLibrary.find(value)) {
+ return;
+ }
+
+ // Report an error.
+ this->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(
+ "Property ", prop, " contains the invalid item \"",
+ linkLibrary.match(2), "\". The ", prop,
+ " property may contain the generator-expression "
+ "\"$<LINK_LIBRARY:...>\" "
+ "which may be used to specify how the libraries are linked."));
+ }
+ }
+}
+
cmTarget* cmMakefile::FindLocalNonAliasTarget(const std::string& name) const
{
auto i = this->Targets.find(name);