From b9fc06735da95cd0f96c96012dd98c7ab5be56e6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 21 Sep 2006 16:10:47 -0400 Subject: BUG: Enabled use of EscapeForShell to properly escape custom command lines. This addresses bug#3786 for Xcode. --- Source/cmGlobalXCodeGenerator.cxx | 3 ++- Source/cmLocalGenerator.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index f886ea6..bfc8c8e 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1037,7 +1037,8 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase, for(unsigned int j=1; j < commandLine.size(); ++j) { cmd += " "; - cmd += cmSystemTools::EscapeSpaces(commandLine[j].c_str()); + cmd += (this->CurrentLocalGenerator + ->EscapeForShell(commandLine[j].c_str())); } makefileStream << "\t" << cmd.c_str() << "\n"; } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 1e324a1..44aa79a 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -201,12 +201,12 @@ public: const char* LanguageCompileFlags; }; -protected: - /** Escape the given string to be used as a command line argument in the native build system shell. */ std::string EscapeForShell(const char* str); +protected: + /** Construct a comment for a custom command. */ std::string ConstructComment(const cmCustomCommand& cc, const char* default_comment = ""); -- cgit v0.12