diff options
author | Brad King <brad.king@kitware.com> | 2013-11-15 18:33:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-18 13:26:21 (GMT) |
commit | 8904d1410be3d62fc48d3bdaa87cbce3895fc815 (patch) | |
tree | 066ea5f6e8910566cc471c852b9782bf7f86e437 /Source/cmGlobalUnixMakefileGenerator3.cxx | |
parent | 0814d0a6559ed3634dafb372f34491407a27c5e8 (diff) | |
download | CMake-8904d1410be3d62fc48d3bdaa87cbce3895fc815.zip CMake-8904d1410be3d62fc48d3bdaa87cbce3895fc815.tar.gz CMake-8904d1410be3d62fc48d3bdaa87cbce3895fc815.tar.bz2 |
cmGlobalGenerator: Cleanup GenerateBuildCommand API
All cmGlobalGenerator::GenerateBuildCommand call sites that need to
produce a string now generate "cmake --build" commands. The remaining
call sites immediately pass the result to cmSystemTools::RunSingleCommand.
Avoid the intermediate string and argument parsing by directly producing a
vector of strings. Also drop the ignoreErrors argument because no call
sites remain that use it.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index cfd93c2..3aa1f5f 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -555,36 +555,27 @@ cmGlobalUnixMakefileGenerator3 this->WriteDirectoryRule2(ruleFileStream, lg, "preinstall", true, true); } - -std::string cmGlobalUnixMakefileGenerator3 -::GenerateBuildCommand(const char* makeProgram, const char *projectName, - const char *projectDir, const char* additionalOptions, - const char *targetName, const char* config, - bool ignoreErrors, bool fast) +//---------------------------------------------------------------------------- +void cmGlobalUnixMakefileGenerator3 +::GenerateBuildCommand(std::vector<std::string>& makeCommand, + const char* makeProgram, + const char* /*projectName*/, + const char* /*projectDir*/, + const char* targetName, + const char* /*config*/, + bool fast, + std::vector<std::string> const& makeOptions) { - // Project name & dir and config are not used yet. - (void)projectName; - (void)projectDir; - (void)config; - - std::string makeCommand = - cmSystemTools::ConvertToUnixOutputPath(makeProgram); + makeCommand.push_back(makeProgram); // Since we have full control over the invocation of nmake, let us // make it quiet. if ( strcmp(this->GetName(), "NMake Makefiles") == 0 ) { - makeCommand += " /NOLOGO "; - } - if ( ignoreErrors ) - { - makeCommand += " -i"; - } - if ( additionalOptions ) - { - makeCommand += " "; - makeCommand += additionalOptions; + makeCommand.push_back("/NOLOGO"); } + makeCommand.insert(makeCommand.end(), + makeOptions.begin(), makeOptions.end()); if ( targetName && strlen(targetName)) { cmLocalUnixMakefileGenerator3 *lg; @@ -605,22 +596,19 @@ std::string cmGlobalUnixMakefileGenerator3 lg->GetMakefile()->MakeStartDirectoriesCurrent(); } - makeCommand += " \""; std::string tname = targetName; if(fast) { tname += "/fast"; } - tname = lg->Convert(tname.c_str(),cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE); - makeCommand += tname.c_str(); - makeCommand += "\""; + tname = lg->Convert(tname.c_str(),cmLocalGenerator::HOME_OUTPUT); + cmSystemTools::ConvertToOutputSlashes(tname); + makeCommand.push_back(tname); if (!this->LocalGenerators.size()) { delete lg; } } - return makeCommand; } //---------------------------------------------------------------------------- |