diff options
author | Bartosz Kosiorek <bartosz.kosiorek@tomtom.com> | 2019-02-08 13:28:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-03-05 13:55:28 (GMT) |
commit | 324d18bb3418aee8dcb63e28106ac0dac6abea71 (patch) | |
tree | 390a0ccc8c8bb955c0330af9bd66621a71ea2041 /Source/cmGlobalNinjaGenerator.cxx | |
parent | ebc94500c1726f393ac6119848d53deca47e1ccf (diff) | |
download | CMake-324d18bb3418aee8dcb63e28106ac0dac6abea71.zip CMake-324d18bb3418aee8dcb63e28106ac0dac6abea71.tar.gz CMake-324d18bb3418aee8dcb63e28106ac0dac6abea71.tar.bz2 |
cmake: Teach --build mode to support multiple targets
Fixes: #16136
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 61571f1..841587c 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -677,12 +677,15 @@ void cmGlobalNinjaGenerator::EnableLanguage( // cmGlobalXCodeGenerator // Called by: // cmGlobalGenerator::Build() -void cmGlobalNinjaGenerator::GenerateBuildCommand( - GeneratedMakeCommand& makeCommand, const std::string& makeProgram, - const std::string& /*projectName*/, const std::string& /*projectDir*/, - const std::string& targetName, const std::string& /*config*/, bool /*fast*/, - int jobs, bool verbose, std::vector<std::string> const& makeOptions) -{ +std::vector<cmGlobalGenerator::GeneratedMakeCommand> +cmGlobalNinjaGenerator::GenerateBuildCommand( + const std::string& makeProgram, const std::string& /*projectName*/, + const std::string& /*projectDir*/, + std::vector<std::string> const& targetNames, const std::string& /*config*/, + bool /*fast*/, int jobs, bool verbose, + std::vector<std::string> const& makeOptions) +{ + GeneratedMakeCommand makeCommand; makeCommand.Add(this->SelectMakeProgram(makeProgram)); if (verbose) { @@ -695,13 +698,16 @@ void cmGlobalNinjaGenerator::GenerateBuildCommand( } makeCommand.Add(makeOptions.begin(), makeOptions.end()); - if (!targetName.empty()) { - if (targetName == "clean") { - makeCommand.Add("-t", "clean"); - } else { - makeCommand.Add(targetName); + for (const auto& tname : targetNames) { + if (!tname.empty()) { + if (tname == "clean") { + makeCommand.Add("-t", "clean"); + } else { + makeCommand.Add(tname); + } } } + return { std::move(makeCommand) }; } // Non-virtual public methods. |