diff options
author | Brad King <brad.king@kitware.com> | 2023-05-01 15:38:16 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-05-01 15:38:32 (GMT) |
commit | 4dc47f82c2a3fc492d4cb94b4d96a24b9fc9cc47 (patch) | |
tree | a76938b9dd21854b079cd0a23de21b1e61cb1eeb /Source/cmMakefileLibraryTargetGenerator.cxx | |
parent | c2100084c85aed33eea1f4abe83442dddc393137 (diff) | |
parent | 241304190ffdf9cc7d4ede0601da370b111468cc (diff) | |
download | CMake-4dc47f82c2a3fc492d4cb94b4d96a24b9fc9cc47.zip CMake-4dc47f82c2a3fc492d4cb94b4d96a24b9fc9cc47.tar.gz CMake-4dc47f82c2a3fc492d4cb94b4d96a24b9fc9cc47.tar.bz2 |
Merge topic 'CMake-uses-cmList-class'
241304190f CMake code rely on cmList class for CMake lists management (part. 2)
87fe031a07 cmList class: various enhancements
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8441
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 43062d9..691edf4 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -305,7 +305,7 @@ void cmMakefileLibraryTargetGenerator::WriteNvidiaDeviceLibraryRules( vars.Language = linkLanguage.c_str(); // Expand the rule variables. - std::vector<std::string> real_link_commands; + cmList real_link_commands; { // Set path conversion for link script shells. this->LocalGenerator->SetLinkScriptShell(useLinkScript); @@ -376,10 +376,10 @@ void cmMakefileLibraryTargetGenerator::WriteNvidiaDeviceLibraryRules( // Construct the main link rule and expand placeholders. rulePlaceholderExpander->SetTargetImpLib(targetOutput); std::string linkRule = this->GetLinkRule(linkRuleVar); - cmExpandList(linkRule, real_link_commands); + real_link_commands.append(linkRule); // Expand placeholders. - for (std::string& real_link_command : real_link_commands) { + for (auto& real_link_command : real_link_commands) { real_link_command = cmStrCat(launcher, real_link_command); rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, real_link_command, vars); @@ -641,9 +641,9 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // For static libraries there might be archiving rules. bool haveStaticLibraryRule = false; - std::vector<std::string> archiveCreateCommands; - std::vector<std::string> archiveAppendCommands; - std::vector<std::string> archiveFinishCommands; + cmList archiveCreateCommands; + cmList archiveAppendCommands; + cmList archiveFinishCommands; std::string::size_type archiveCommandLimit = std::string::npos; if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { haveStaticLibraryRule = this->Makefile->IsDefinitionSet(linkRuleVar); @@ -653,21 +653,23 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( arCreateVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable( arCreateVar, linkLanguage, this->GetConfigName()); - this->Makefile->GetDefExpandList(arCreateVar, archiveCreateCommands); + archiveCreateCommands.assign(this->Makefile->GetDefinition(arCreateVar)); + std::string arAppendVar = cmStrCat("CMAKE_", linkLanguage, "_ARCHIVE_APPEND"); arAppendVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable( arAppendVar, linkLanguage, this->GetConfigName()); - this->Makefile->GetDefExpandList(arAppendVar, archiveAppendCommands); + archiveAppendCommands.assign(this->Makefile->GetDefinition(arAppendVar)); + std::string arFinishVar = cmStrCat("CMAKE_", linkLanguage, "_ARCHIVE_FINISH"); arFinishVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable( arFinishVar, linkLanguage, this->GetConfigName()); - this->Makefile->GetDefExpandList(arFinishVar, archiveFinishCommands); + archiveFinishCommands.assign(this->Makefile->GetDefinition(arFinishVar)); } // Decide whether to use archiving rules. @@ -695,7 +697,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( this->LocalGenerator->CreateRulePlaceholderExpander()); bool useWatcomQuote = this->Makefile->IsOn(linkRuleVar + "_USE_WATCOM_QUOTE"); - std::vector<std::string> real_link_commands; + cmList real_link_commands; { // Set path conversion for link script shells. this->LocalGenerator->SetLinkScriptShell(useLinkScript); @@ -880,7 +882,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } else { // Get the set of commands. std::string linkRule = this->GetLinkRule(linkRuleVar); - cmExpandList(linkRule, real_link_commands); + real_link_commands.append(linkRule); if (this->UseLWYU) { cmValue lwyuCheck = this->Makefile->GetDefinition("CMAKE_LINK_WHAT_YOU_USE_CHECK"); @@ -896,7 +898,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } // Expand placeholders. - for (std::string& real_link_command : real_link_commands) { + for (auto& real_link_command : real_link_commands) { real_link_command = cmStrCat(launcher, real_link_command); rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, real_link_command, vars); |