diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-02-10 22:04:32 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-02-10 22:04:32 (GMT) |
commit | c3800e54583208ac4a6435884bb8832e72af3183 (patch) | |
tree | 12e2b0c67f170e1521cb013b79becc0c419e1a5a /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | ee3295e91740033ebe9d9a0c800c0a3070108624 (diff) | |
download | CMake-c3800e54583208ac4a6435884bb8832e72af3183.zip CMake-c3800e54583208ac4a6435884bb8832e72af3183.tar.gz CMake-c3800e54583208ac4a6435884bb8832e72af3183.tar.bz2 |
cmAlgorithms: add cmEraseIf function
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 18 |
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"); |