summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-15 18:33:32 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-18 13:26:21 (GMT)
commit8904d1410be3d62fc48d3bdaa87cbce3895fc815 (patch)
tree066ea5f6e8910566cc471c852b9782bf7f86e437 /Source/cmGlobalNinjaGenerator.cxx
parent0814d0a6559ed3634dafb372f34491407a27c5e8 (diff)
downloadCMake-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/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx47
1 files changed, 16 insertions, 31 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index e938065..24bfdc3 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -549,47 +549,32 @@ bool cmGlobalNinjaGenerator::UsingMinGW = false;
// cmGlobalXCodeGenerator
// Called by:
// cmGlobalGenerator::Build()
-std::string cmGlobalNinjaGenerator
-::GenerateBuildCommand(const char* makeProgram,
- const char* projectName,
- const char* projectDir,
- const char* additionalOptions,
+void cmGlobalNinjaGenerator
+::GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ const char* makeProgram,
+ const char* /*projectName*/,
+ const char* /*projectDir*/,
const char* targetName,
- const char* config,
- bool ignoreErrors,
- bool fast)
+ 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;
- // Ninja does not have -i equivalent option yet.
- (void)ignoreErrors;
- // We do not handle fast build yet.
- (void)fast;
-
- std::string makeCommand =
- cmSystemTools::ConvertToUnixOutputPath(makeProgram);
-
- if(additionalOptions)
- {
- makeCommand += " ";
- makeCommand += additionalOptions;
- }
- if(targetName)
+ makeCommand.push_back(makeProgram);
+
+ makeCommand.insert(makeCommand.end(),
+ makeOptions.begin(), makeOptions.end());
+ if(targetName && *targetName)
{
if(strcmp(targetName, "clean") == 0)
{
- makeCommand += " -t clean";
+ makeCommand.push_back("-t");
+ makeCommand.push_back("clean");
}
else
{
- makeCommand += " ";
- makeCommand += targetName;
+ makeCommand.push_back(targetName);
}
}
-
- return makeCommand;
}
//----------------------------------------------------------------------------