ENH: Updated GetRecursiveMakeCall to use EscapeForShell instead of MAKEFILE conversion. This code is special because it is the only place that a make target name is passed on a command line.
This commit is contained in:
parent
91c2b84a92
commit
7157743d69
@ -1745,17 +1745,15 @@ cmLocalUnixMakefileGenerator3
|
|||||||
// Add the target.
|
// Add the target.
|
||||||
if (tgt && tgt[0] != '\0')
|
if (tgt && tgt[0] != '\0')
|
||||||
{
|
{
|
||||||
std::string tgt2 = this->Convert(tgt,HOME_OUTPUT,MAKEFILE);
|
// The make target is always relative to the top of the build tree.
|
||||||
// for make -f foo bar, foo is a file but bar (tgt2) is
|
std::string tgt2 = this->Convert(tgt, HOME_OUTPUT);
|
||||||
// a make target. make targets should be escaped with ""
|
|
||||||
// and not \, so if we find a "\ " in the path then remove
|
// The target may have been written with windows paths.
|
||||||
// the \ and quote the whole string
|
cmSystemTools::ConvertToOutputSlashes(tgt2);
|
||||||
if(tgt2.find("\\ ") != tgt2.npos)
|
|
||||||
{
|
// The target name is now a string that should be passed verbatim
|
||||||
cmSystemTools::ReplaceString(tgt2, "\\", "");
|
// on the command line.
|
||||||
tgt2 = std::string("\"") + tgt2 + std::string("\"");
|
cmd += this->EscapeForShell(tgt2.c_str(), true, false);
|
||||||
}
|
|
||||||
cmd += tgt2;
|
|
||||||
}
|
}
|
||||||
return cmd;
|
return cmd;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user