From d35651fb6c59904b3b004474a5501280e694d37c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 4 Mar 2009 15:38:47 -0500 Subject: ENH: Extend GG::Build method for pre-parsed args This adds an argument to the cmGlobalGenerator::Build method to pass a vector of arguments for the native build tool programatically. --- Source/cmGlobalGenerator.cxx | 15 ++++++++++++--- Source/cmGlobalGenerator.h | 16 +++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 0103a85..23bb1a2 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1125,7 +1125,8 @@ int cmGlobalGenerator::Build( bool clean, bool fast, double timeout, bool verbose, - const char* extraOptions) + const char* extraOptions, + std::vector const& nativeOptions) { /** * Run an executable command and put the stdout in output. @@ -1194,8 +1195,16 @@ int cmGlobalGenerator::Build( *output += makeCommand; *output += "\n"; } - - if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), outputPtr, + + std::vector command = + cmSystemTools::ParseArguments(makeCommand.c_str()); + for(std::vector::const_iterator ni = nativeOptions.begin(); + ni != nativeOptions.end(); ++ni) + { + command.push_back(*ni); + } + + if (!cmSystemTools::RunSingleCommand(command, outputPtr, &retVal, 0, verbose, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 2d8ffb6..c3c2ef5 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -100,13 +100,15 @@ public: * empty then all is assumed. clean indicates if a "make clean" should be * done first. */ - virtual int Build(const char *srcdir, const char *bindir, - const char *projectName, const char *targetName, - std::string *output, - const char *makeProgram, const char *config, - bool clean, bool fast, - double timeout, bool verbose=false, - const char* extraOptions = 0); + int Build(const char *srcdir, const char *bindir, + const char *projectName, const char *targetName, + std::string *output, + const char *makeProgram, const char *config, + bool clean, bool fast, + double timeout, bool verbose=false, + const char* extraOptions = 0, + std::vector const& nativeOptions = + std::vector()); virtual std::string GenerateBuildCommand( const char* makeProgram, -- cgit v0.12