cmMakefile: Replace loop with composed algorithm.
This commit is contained in:
parent
e6ca1b8274
commit
470cff497b
@ -1472,18 +1472,11 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
|
|||||||
cmSystemTools::ExpandListArgument(cdefs, defs);
|
cmSystemTools::ExpandListArgument(cdefs, defs);
|
||||||
|
|
||||||
// Recompose the list without the definition.
|
// Recompose the list without the definition.
|
||||||
std::string ndefs;
|
std::vector<std::string>::const_iterator defEnd =
|
||||||
const char* sep = "";
|
std::remove(defs.begin(), defs.end(), define);
|
||||||
for(std::vector<std::string>::const_iterator di = defs.begin();
|
std::vector<std::string>::const_iterator defBegin =
|
||||||
di != defs.end(); ++di)
|
defs.begin();
|
||||||
{
|
std::string ndefs = cmJoin(cmRange(defBegin, defEnd), ";");
|
||||||
if(*di != define)
|
|
||||||
{
|
|
||||||
ndefs += sep;
|
|
||||||
sep = ";";
|
|
||||||
ndefs += *di;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store the new list.
|
// Store the new list.
|
||||||
this->SetProperty("COMPILE_DEFINITIONS", ndefs.c_str());
|
this->SetProperty("COMPILE_DEFINITIONS", ndefs.c_str());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user