BUG: Fixed display of custom command comments with quotes, dollars, and other special characters in them.
This commit is contained in:
parent
038c9e27d7
commit
406f3554c7
@ -43,7 +43,6 @@ void cmGlobalBorlandMakefileGenerator
|
|||||||
cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
|
cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
|
||||||
{
|
{
|
||||||
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
||||||
lg->SetEchoNeedsQuote(false);
|
|
||||||
lg->SetIncludeDirective("!include");
|
lg->SetIncludeDirective("!include");
|
||||||
lg->SetWindowsShell(true);
|
lg->SetWindowsShell(true);
|
||||||
lg->SetDefineWindowsNULL(true);
|
lg->SetDefineWindowsNULL(true);
|
||||||
|
@ -39,7 +39,6 @@ void cmGlobalNMakeMakefileGenerator
|
|||||||
cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
|
cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
|
||||||
{
|
{
|
||||||
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
||||||
lg->SetEchoNeedsQuote(false);
|
|
||||||
lg->SetDefineWindowsNULL(true);
|
lg->SetDefineWindowsNULL(true);
|
||||||
lg->SetWindowsShell(true);
|
lg->SetWindowsShell(true);
|
||||||
lg->SetMakeSilentFlag("/nologo");
|
lg->SetMakeSilentFlag("/nologo");
|
||||||
|
@ -48,7 +48,6 @@ cmLocalGenerator *cmGlobalWatcomWMakeGenerator::CreateLocalGenerator()
|
|||||||
{
|
{
|
||||||
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
||||||
lg->SetSilentNoColon(true);
|
lg->SetSilentNoColon(true);
|
||||||
lg->SetEchoNeedsQuote(false);
|
|
||||||
lg->SetDefineWindowsNULL(true);
|
lg->SetDefineWindowsNULL(true);
|
||||||
lg->SetWindowsShell(true);
|
lg->SetWindowsShell(true);
|
||||||
lg->SetMakeSilentFlag("-s -h");
|
lg->SetMakeSilentFlag("-s -h");
|
||||||
|
@ -2278,7 +2278,8 @@ std::string cmLocalGenerator::EscapeForShellOldStyle(const char* str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars)
|
std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars,
|
||||||
|
bool forEcho)
|
||||||
{
|
{
|
||||||
// Compute the flags for the target shell environment.
|
// Compute the flags for the target shell environment.
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
@ -2294,6 +2295,10 @@ std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars)
|
|||||||
{
|
{
|
||||||
flags |= cmsysSystem_Shell_Flag_AllowMakeVariables;
|
flags |= cmsysSystem_Shell_Flag_AllowMakeVariables;
|
||||||
}
|
}
|
||||||
|
if(forEcho)
|
||||||
|
{
|
||||||
|
flags |= cmsysSystem_Shell_Flag_EchoWindows;
|
||||||
|
}
|
||||||
|
|
||||||
// Compute the buffer size needed.
|
// Compute the buffer size needed.
|
||||||
int size = (this->WindowsShell ?
|
int size = (this->WindowsShell ?
|
||||||
|
@ -204,8 +204,11 @@ public:
|
|||||||
|
|
||||||
/** Escape the given string to be used as a command line argument in
|
/** Escape the given string to be used as a command line argument in
|
||||||
the native build system shell. Optionally allow the build
|
the native build system shell. Optionally allow the build
|
||||||
system to replace make variable references. */
|
system to replace make variable references. Optionally adjust
|
||||||
std::string EscapeForShell(const char* str, bool makeVars = false);
|
escapes for the special case of passing to the native echo
|
||||||
|
command. */
|
||||||
|
std::string EscapeForShell(const char* str, bool makeVars = false,
|
||||||
|
bool forEcho = false);
|
||||||
|
|
||||||
/** Backwards-compatibility version of EscapeForShell. */
|
/** Backwards-compatibility version of EscapeForShell. */
|
||||||
std::string EscapeForShellOldStyle(const char* str);
|
std::string EscapeForShellOldStyle(const char* str);
|
||||||
|
@ -44,7 +44,6 @@ cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3()
|
|||||||
this->MakefileVariableSize = 0;
|
this->MakefileVariableSize = 0;
|
||||||
this->IgnoreLibPrefix = false;
|
this->IgnoreLibPrefix = false;
|
||||||
this->PassMakeflags = false;
|
this->PassMakeflags = false;
|
||||||
this->EchoNeedsQuote = true;
|
|
||||||
this->DefineWindowsNULL = false;
|
this->DefineWindowsNULL = false;
|
||||||
this->UnixCD = true;
|
this->UnixCD = true;
|
||||||
this->ForceVerboseMakefiles=false;
|
this->ForceVerboseMakefiles=false;
|
||||||
@ -1046,24 +1045,14 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands,
|
|||||||
{
|
{
|
||||||
// Use the native echo command.
|
// Use the native echo command.
|
||||||
cmd = "@echo ";
|
cmd = "@echo ";
|
||||||
if(this->EchoNeedsQuote)
|
cmd += this->EscapeForShell(line.c_str(), false, true);
|
||||||
{
|
|
||||||
cmd += "\"";
|
|
||||||
}
|
|
||||||
cmd += line;
|
|
||||||
if(this->EchoNeedsQuote)
|
|
||||||
{
|
|
||||||
cmd += "\"";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Use cmake to echo the text in color.
|
// Use cmake to echo the text in color.
|
||||||
cmd = "@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) ";
|
cmd = "@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) ";
|
||||||
cmd += color_name;
|
cmd += color_name;
|
||||||
cmd += "\"";
|
cmd += this->EscapeForShell(line.c_str());
|
||||||
cmd += line;
|
|
||||||
cmd += "\"";
|
|
||||||
}
|
}
|
||||||
commands.push_back(cmd);
|
commands.push_back(cmd);
|
||||||
}
|
}
|
||||||
|
@ -97,9 +97,6 @@ public:
|
|||||||
void SetMakeSilentFlag(const char* s) { this->MakeSilentFlag = s; }
|
void SetMakeSilentFlag(const char* s) { this->MakeSilentFlag = s; }
|
||||||
std::string &GetMakeSilentFlag() { return this->MakeSilentFlag; }
|
std::string &GetMakeSilentFlag() { return this->MakeSilentFlag; }
|
||||||
|
|
||||||
/** Set whether the echo command needs its argument quoted. */
|
|
||||||
void SetEchoNeedsQuote(bool b) { this->EchoNeedsQuote = b; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to true if the shell being used is the windows shell.
|
* Set to true if the shell being used is the windows shell.
|
||||||
* This controls if statements in the makefile and the SHELL variable.
|
* This controls if statements in the makefile and the SHELL variable.
|
||||||
@ -339,8 +336,6 @@ private:
|
|||||||
bool UnixCD;
|
bool UnixCD;
|
||||||
bool PassMakeflags;
|
bool PassMakeflags;
|
||||||
bool SilentNoColon;
|
bool SilentNoColon;
|
||||||
// Flag for whether echo command needs quotes.
|
|
||||||
bool EchoNeedsQuote;
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
std::string HomeRelativeOutputPath;
|
std::string HomeRelativeOutputPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user