diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-01-28 16:00:43 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-01-31 15:07:02 (GMT) |
commit | 332d2f8f528bcd454d36dd162454fdc4802c6b6c (patch) | |
tree | ef6c79259d4c0354873a56e0926a057d7ba96400 /Source/cmTarget.cxx | |
parent | 15eec07500dfeafaf81536ba08ef82f779831f1c (diff) | |
download | CMake-332d2f8f528bcd454d36dd162454fdc4802c6b6c.zip CMake-332d2f8f528bcd454d36dd162454fdc4802c6b6c.tar.gz CMake-332d2f8f528bcd454d36dd162454fdc4802c6b6c.tar.bz2 |
cmTarget: refactor INTERFACE_LINK_LIBRARIES_DIRECT usage requirements
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 84f9871..629ecb8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -305,7 +305,6 @@ public: std::map<std::string, BTs<std::string>> LanguageStandardProperties; std::map<cmTargetExport const*, std::vector<std::string>> InstallIncludeDirectoriesEntries; - std::vector<BT<std::string>> LinkInterfaceDirectPropertyEntries; std::vector<BT<std::string>> LinkInterfaceDirectExcludePropertyEntries; std::vector<std::pair<cmTarget::TLLSignature, cmListFileContext>> TLLCommands; @@ -322,6 +321,7 @@ public: UsageRequirementProperty LinkDirectories; UsageRequirementProperty LinkLibraries; UsageRequirementProperty InterfaceLinkLibraries; + UsageRequirementProperty InterfaceLinkLibrariesDirect; FileSetType HeadersFileSets; FileSetType CxxModulesFileSets; @@ -368,6 +368,7 @@ cmTargetInternals::cmTargetInternals() , LinkDirectories("LINK_DIRECTORIES"_s) , LinkLibraries("LINK_LIBRARIES"_s) , InterfaceLinkLibraries("INTERFACE_LINK_LIBRARIES"_s) + , InterfaceLinkLibrariesDirect("INTERFACE_LINK_LIBRARIES_DIRECT"_s) , HeadersFileSets("HEADERS"_s, "HEADER_DIRS"_s, "HEADER_SET"_s, "HEADER_DIRS_"_s, "HEADER_SET_"_s, "Header"_s, "The default header set"_s, "Header set"_s, @@ -1510,7 +1511,7 @@ cmBTStringRange cmTarget::GetLinkInterfaceEntries() const cmBTStringRange cmTarget::GetLinkInterfaceDirectEntries() const { - return cmMakeRange(this->impl->LinkInterfaceDirectPropertyEntries); + return cmMakeRange(this->impl->InterfaceLinkLibrariesDirect.Entries); } cmBTStringRange cmTarget::GetLinkInterfaceDirectExcludeEntries() const @@ -1645,11 +1646,17 @@ void cmTarget::StoreProperty(const std::string& prop, ValueType value) } UsageRequirementProperty* usageRequirements[] = { - &this->impl->IncludeDirectories, &this->impl->CompileOptions, - &this->impl->CompileFeatures, &this->impl->CompileDefinitions, - &this->impl->PrecompileHeaders, &this->impl->Sources, - &this->impl->LinkOptions, &this->impl->LinkDirectories, - &this->impl->LinkLibraries, &this->impl->InterfaceLinkLibraries, + &this->impl->IncludeDirectories, + &this->impl->CompileOptions, + &this->impl->CompileFeatures, + &this->impl->CompileDefinitions, + &this->impl->PrecompileHeaders, + &this->impl->Sources, + &this->impl->LinkOptions, + &this->impl->LinkDirectories, + &this->impl->LinkLibraries, + &this->impl->InterfaceLinkLibraries, + &this->impl->InterfaceLinkLibrariesDirect, }; for (auto* usageRequirement : usageRequirements) { @@ -1672,13 +1679,7 @@ void cmTarget::StoreProperty(const std::string& prop, ValueType value) } } - if (prop == propINTERFACE_LINK_LIBRARIES_DIRECT) { - this->impl->LinkInterfaceDirectPropertyEntries.clear(); - if (value) { - cmListFileBacktrace lfbt = this->impl->Makefile->GetBacktrace(); - this->impl->LinkInterfaceDirectPropertyEntries.emplace_back(value, lfbt); - } - } else if (prop == propINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE) { + if (prop == propINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE) { this->impl->LinkInterfaceDirectExcludePropertyEntries.clear(); if (value) { cmListFileBacktrace lfbt = this->impl->Makefile->GetBacktrace(); @@ -1801,11 +1802,17 @@ void cmTarget::AppendProperty(const std::string& prop, } UsageRequirementProperty* usageRequirements[] = { - &this->impl->IncludeDirectories, &this->impl->CompileOptions, - &this->impl->CompileFeatures, &this->impl->CompileDefinitions, - &this->impl->PrecompileHeaders, &this->impl->Sources, - &this->impl->LinkOptions, &this->impl->LinkDirectories, - &this->impl->LinkLibraries, &this->impl->InterfaceLinkLibraries, + &this->impl->IncludeDirectories, + &this->impl->CompileOptions, + &this->impl->CompileFeatures, + &this->impl->CompileDefinitions, + &this->impl->PrecompileHeaders, + &this->impl->Sources, + &this->impl->LinkOptions, + &this->impl->LinkDirectories, + &this->impl->LinkLibraries, + &this->impl->InterfaceLinkLibraries, + &this->impl->InterfaceLinkLibrariesDirect, }; for (auto* usageRequirement : usageRequirements) { @@ -1828,12 +1835,7 @@ void cmTarget::AppendProperty(const std::string& prop, } } - if (prop == propINTERFACE_LINK_LIBRARIES_DIRECT) { - if (!value.empty()) { - cmListFileBacktrace lfbt = this->impl->GetBacktrace(bt); - this->impl->LinkInterfaceDirectPropertyEntries.emplace_back(value, lfbt); - } - } else if (prop == propINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE) { + if (prop == propINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE) { if (!value.empty()) { cmListFileBacktrace lfbt = this->impl->GetBacktrace(bt); this->impl->LinkInterfaceDirectExcludePropertyEntries.emplace_back(value, @@ -2038,9 +2040,10 @@ void cmTarget::FinalizeTargetConfiguration( !CheckLinkLibraryPattern("INTERFACE_LINK_LIBRARIES"_s, this->impl->InterfaceLinkLibraries.Entries, this->GetMakefile()->GetCMakeInstance()) || - !CheckLinkLibraryPattern("INTERFACE_LINK_LIBRARIES_DIRECT"_s, - this->impl->LinkInterfaceDirectPropertyEntries, - this->GetMakefile()->GetCMakeInstance())) { + !CheckLinkLibraryPattern( + "INTERFACE_LINK_LIBRARIES_DIRECT"_s, + this->impl->InterfaceLinkLibrariesDirect.Entries, + this->GetMakefile()->GetCMakeInstance())) { return; } @@ -2269,11 +2272,17 @@ cmValue cmTarget::GetProperty(const std::string& prop) const } UsageRequirementProperty const* usageRequirements[] = { - &this->impl->IncludeDirectories, &this->impl->CompileOptions, - &this->impl->CompileFeatures, &this->impl->CompileDefinitions, - &this->impl->PrecompileHeaders, &this->impl->Sources, - &this->impl->LinkOptions, &this->impl->LinkDirectories, - &this->impl->LinkLibraries, &this->impl->InterfaceLinkLibraries, + &this->impl->IncludeDirectories, + &this->impl->CompileOptions, + &this->impl->CompileFeatures, + &this->impl->CompileDefinitions, + &this->impl->PrecompileHeaders, + &this->impl->Sources, + &this->impl->LinkOptions, + &this->impl->LinkDirectories, + &this->impl->LinkLibraries, + &this->impl->InterfaceLinkLibraries, + &this->impl->InterfaceLinkLibrariesDirect, }; for (auto const* usageRequirement : usageRequirements) { @@ -2283,15 +2292,6 @@ cmValue cmTarget::GetProperty(const std::string& prop) const } } - if (prop == propINTERFACE_LINK_LIBRARIES_DIRECT) { - if (this->impl->LinkInterfaceDirectPropertyEntries.empty()) { - return nullptr; - } - - static std::string output; - output = cmJoin(this->impl->LinkInterfaceDirectPropertyEntries, ";"); - return cmValue(output); - } if (prop == propINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE) { if (this->impl->LinkInterfaceDirectExcludePropertyEntries.empty()) { return nullptr; |