summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-13 16:41:46 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-02-13 16:41:46 (GMT)
commit0c4379353fb82e0d5223e82faeaf14f4dcc7a80b (patch)
treee33b55bef405ef6171da40a1d90c125bc5e8ad76 /Source/cmNinjaNormalTargetGenerator.cxx
parent0cab748cf84a844df36623f03c5ed7b8065ceb5a (diff)
parentc3800e54583208ac4a6435884bb8832e72af3183 (diff)
downloadCMake-0c4379353fb82e0d5223e82faeaf14f4dcc7a80b.zip
CMake-0c4379353fb82e0d5223e82faeaf14f4dcc7a80b.tar.gz
CMake-0c4379353fb82e0d5223e82faeaf14f4dcc7a80b.tar.bz2
Merge topic 'erase-if'
c3800e54 cmAlgorithms: add cmEraseIf function
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index b172478..9bf0ccd 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -260,12 +260,9 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRule(bool useResponseFile)
rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(),
*i, vars);
}
- {
- // If there is no ranlib the command will be ":". Skip it.
- std::vector<std::string>::iterator newEnd = std::remove_if(
- linkCmds.begin(), linkCmds.end(), cmNinjaRemoveNoOpCommands());
- linkCmds.erase(newEnd, linkCmds.end());
- }
+
+ // If there is no ranlib the command will be ":". Skip it.
+ cmEraseIf(linkCmds, cmNinjaRemoveNoOpCommands());
std::string linkCmd =
this->GetLocalGenerator()->BuildCommandLine(linkCmds);
@@ -388,12 +385,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(),
*i, vars);
}
- {
- // If there is no ranlib the command will be ":". Skip it.
- std::vector<std::string>::iterator newEnd = std::remove_if(
- linkCmds.begin(), linkCmds.end(), cmNinjaRemoveNoOpCommands());
- linkCmds.erase(newEnd, linkCmds.end());
- }
+
+ // If there is no ranlib the command will be ":". Skip it.
+ cmEraseIf(linkCmds, cmNinjaRemoveNoOpCommands());
linkCmds.insert(linkCmds.begin(), "$PRE_LINK");
linkCmds.push_back("$POST_BUILD");