diff options
author | Brad King <brad.king@kitware.com> | 2017-09-13 12:34:49 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-09-13 12:35:05 (GMT) |
commit | 67810849b95acfe036a9a605dbda6f0a3d6f7493 (patch) | |
tree | fa63356603dd00956f306eb92d4ecdbca9e450d4 /Source/cmMakefileLibraryTargetGenerator.cxx | |
parent | a763cffd6b65bbe5572527e39969981bf31d5aca (diff) | |
parent | 7d5095796ab616cf9b709036387bb95ab9984141 (diff) | |
download | CMake-67810849b95acfe036a9a605dbda6f0a3d6f7493.zip CMake-67810849b95acfe036a9a605dbda6f0a3d6f7493.tar.gz CMake-67810849b95acfe036a9a605dbda6f0a3d6f7493.tar.bz2 |
Merge topic 'ranged-for'
7d509579 Meta: modernize old-fashioned loops to range-based `for`.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1249
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 2faef67..34c285c 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -419,11 +419,10 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules( cmSystemTools::ExpandListArgument(linkRule, real_link_commands); // Expand placeholders. - for (std::vector<std::string>::iterator i = real_link_commands.begin(); - i != real_link_commands.end(); ++i) { - *i = launcher + *i; - rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, *i, - vars); + for (std::string& real_link_command : real_link_commands) { + real_link_command = launcher + real_link_command; + rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, + real_link_command, vars); } // Restore path conversion to normal shells. this->LocalGenerator->SetLinkScriptShell(false); @@ -897,10 +896,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( std::vector<std::string>::iterator osi = object_strings.begin(); { vars.Objects = osi->c_str(); - for (std::vector<std::string>::const_iterator i = - archiveCreateCommands.begin(); - i != archiveCreateCommands.end(); ++i) { - std::string cmd = launcher + *i; + for (std::string const& acc : archiveCreateCommands) { + std::string cmd = launcher + acc; rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, cmd, vars); real_link_commands.push_back(cmd); @@ -909,10 +906,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Append to the archive with the other object sets. for (++osi; osi != object_strings.end(); ++osi) { vars.Objects = osi->c_str(); - for (std::vector<std::string>::const_iterator i = - archiveAppendCommands.begin(); - i != archiveAppendCommands.end(); ++i) { - std::string cmd = launcher + *i; + for (std::string const& aac : archiveAppendCommands) { + std::string cmd = launcher + aac; rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, cmd, vars); real_link_commands.push_back(cmd); @@ -920,10 +915,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } // Finish the archive. vars.Objects = ""; - for (std::vector<std::string>::const_iterator i = - archiveFinishCommands.begin(); - i != archiveFinishCommands.end(); ++i) { - std::string cmd = launcher + *i; + for (std::string const& afc : archiveFinishCommands) { + std::string cmd = launcher + afc; rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, cmd, vars); // If there is no ranlib the command will be ":". Skip it. @@ -945,11 +938,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } // Expand placeholders. - for (std::vector<std::string>::iterator i = real_link_commands.begin(); - i != real_link_commands.end(); ++i) { - *i = launcher + *i; - rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, *i, - vars); + for (std::string& real_link_command : real_link_commands) { + real_link_command = launcher + real_link_command; + rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, + real_link_command, vars); } } |