diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2023-04-14 14:48:16 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2023-04-24 08:41:10 (GMT) |
commit | e08ba229ee3107bcb814ca45bc9c72a48abf1ba2 (patch) | |
tree | c34d2ca05820acbb31202c5bdbc102059441076b /Source/cmComputeLinkInformation.cxx | |
parent | 51b0d45d9120d4bca5c7285d5e6b2f80db5a8310 (diff) | |
download | CMake-e08ba229ee3107bcb814ca45bc9c72a48abf1ba2.zip CMake-e08ba229ee3107bcb814ca45bc9c72a48abf1ba2.tar.gz CMake-e08ba229ee3107bcb814ca45bc9c72a48abf1ba2.tar.bz2 |
CMake code rely on cmList class for CMake lists management (part. 1)
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index a93477b..6a5b4cc 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -15,6 +15,7 @@ #include "cmComputeLinkDepends.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" @@ -858,8 +859,8 @@ bool cmComputeLinkInformation::AddLibraryFeature(std::string const& feature) return false; } - auto items = cmExpandListWithBacktrace(*langFeature, - this->Target->GetBacktrace(), true); + auto items = cmExpandListWithBacktrace( + *langFeature, this->Target->GetBacktrace(), cmList::EmptyElements::Yes); if ((items.size() == 1 && !IsValidFeatureFormat(items.front().Value)) || (items.size() == 3 && !IsValidFeatureFormat(items[1].Value))) { @@ -1016,8 +1017,8 @@ cmComputeLinkInformation::GetGroupFeature(std::string const& feature) .first->second; } - auto items = cmExpandListWithBacktrace(*langFeature, - this->Target->GetBacktrace(), true); + auto items = cmExpandListWithBacktrace( + *langFeature, this->Target->GetBacktrace(), cmList::EmptyElements::Yes); // replace LINKER: pattern this->Target->ResolveLinkerWrapper(items, this->LinkLanguage, true); @@ -1072,8 +1073,8 @@ void cmComputeLinkInformation::AddRuntimeLinkLibrary(std::string const& lang) } if (cmValue runtimeLinkOptions = this->Makefile->GetDefinition(cmStrCat( "CMAKE_", lang, "_RUNTIME_LIBRARY_LINK_OPTIONS_", runtimeLibrary))) { - std::vector<std::string> libsVec = cmExpandedList(*runtimeLinkOptions); - for (std::string const& i : libsVec) { + cmList libs{ *runtimeLinkOptions }; + for (auto const& i : libs) { if (!cm::contains(this->ImplicitLinkLibs, i)) { this->AddItem({ i }); } @@ -1087,8 +1088,8 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang) // linker language. std::string libVar = cmStrCat("CMAKE_", lang, "_IMPLICIT_LINK_LIBRARIES"); if (cmValue libs = this->Makefile->GetDefinition(libVar)) { - std::vector<std::string> libsVec = cmExpandedList(*libs); - for (std::string const& i : libsVec) { + cmList libsList{ *libs }; + for (auto const& i : libsList) { if (!cm::contains(this->ImplicitLinkLibs, i)) { this->AddItem({ i }); } @@ -1099,8 +1100,8 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang) // implied by the linker language. std::string dirVar = cmStrCat("CMAKE_", lang, "_IMPLICIT_LINK_DIRECTORIES"); if (cmValue dirs = this->Makefile->GetDefinition(dirVar)) { - std::vector<std::string> dirsVec = cmExpandedList(*dirs); - this->OrderLinkerSearchPath->AddLanguageDirectories(dirsVec); + cmList dirsList{ *dirs }; + this->OrderLinkerSearchPath->AddLanguageDirectories(dirsList); } } @@ -1370,15 +1371,15 @@ void cmComputeLinkInformation::ComputeItemParserInfo() LinkUnknown); if (cmValue linkSuffixes = mf->GetDefinition("CMAKE_EXTRA_LINK_EXTENSIONS")) { - std::vector<std::string> linkSuffixVec = cmExpandedList(*linkSuffixes); - for (std::string const& i : linkSuffixVec) { + cmList linkSuffixList{ *linkSuffixes }; + for (auto const& i : linkSuffixList) { this->AddLinkExtension(i, LinkUnknown); } } if (cmValue sharedSuffixes = mf->GetDefinition("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES")) { - std::vector<std::string> sharedSuffixVec = cmExpandedList(*sharedSuffixes); - for (std::string const& i : sharedSuffixVec) { + cmList sharedSuffixList{ *sharedSuffixes }; + for (std::string const& i : sharedSuffixList) { this->AddLinkExtension(i, LinkShared); } } @@ -2279,7 +2280,7 @@ static void cmCLI_ExpandListUnique(std::string const& str, std::vector<std::string>& out, std::set<std::string>& emitted) { - std::vector<std::string> tmp = cmExpandedList(str); + cmList tmp{ str }; for (std::string const& i : tmp) { if (emitted.insert(i).second) { out.push_back(i); |