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.
This commit is contained in:
Brad King 2009-03-04 15:38:47 -05:00
parent f9dd6a38c5
commit d35651fb6c
2 changed files with 21 additions and 10 deletions

View File

@ -1125,7 +1125,8 @@ int cmGlobalGenerator::Build(
bool clean, bool fast, bool clean, bool fast,
double timeout, double timeout,
bool verbose, bool verbose,
const char* extraOptions) const char* extraOptions,
std::vector<std::string> const& nativeOptions)
{ {
/** /**
* Run an executable command and put the stdout in output. * Run an executable command and put the stdout in output.
@ -1195,7 +1196,15 @@ int cmGlobalGenerator::Build(
*output += "\n"; *output += "\n";
} }
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), outputPtr, std::vector<cmStdString> command =
cmSystemTools::ParseArguments(makeCommand.c_str());
for(std::vector<std::string>::const_iterator ni = nativeOptions.begin();
ni != nativeOptions.end(); ++ni)
{
command.push_back(*ni);
}
if (!cmSystemTools::RunSingleCommand(command, outputPtr,
&retVal, 0, verbose, timeout)) &retVal, 0, verbose, timeout))
{ {
cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::SetRunCommandHideConsole(hideconsole);

View File

@ -100,13 +100,15 @@ public:
* empty then all is assumed. clean indicates if a "make clean" should be * empty then all is assumed. clean indicates if a "make clean" should be
* done first. * done first.
*/ */
virtual int Build(const char *srcdir, const char *bindir, int Build(const char *srcdir, const char *bindir,
const char *projectName, const char *targetName, const char *projectName, const char *targetName,
std::string *output, std::string *output,
const char *makeProgram, const char *config, const char *makeProgram, const char *config,
bool clean, bool fast, bool clean, bool fast,
double timeout, bool verbose=false, double timeout, bool verbose=false,
const char* extraOptions = 0); const char* extraOptions = 0,
std::vector<std::string> const& nativeOptions =
std::vector<std::string>());
virtual std::string GenerateBuildCommand( virtual std::string GenerateBuildCommand(
const char* makeProgram, const char* makeProgram,