summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-29 14:19:31 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-01-29 14:19:39 (GMT)
commit9620cb935a49e7b4955f5b1d0ffa2e93b4327591 (patch)
treed0e011b3649793502929e4e0597b6d636fdc57ec /Source/cmGlobalUnixMakefileGenerator3.cxx
parent60c06620a690f0cbeeaa3fba762e19cd031669ca (diff)
parent66801f4d40227c46904ad54848bd1da959604cbf (diff)
downloadCMake-9620cb935a49e7b4955f5b1d0ffa2e93b4327591.zip
CMake-9620cb935a49e7b4955f5b1d0ffa2e93b4327591.tar.gz
CMake-9620cb935a49e7b4955f5b1d0ffa2e93b4327591.tar.bz2
Merge topic 'add_consistent_verbose_build_flag'
66801f4d40 cmake: Add tests for verbose output to --build mode 439fe2e253 cmake: Add options for verbose output to --build mode 638667efa2 cmake: cmcmd.cxx fix "The arguments are" comments 3ca4402966 ctest: Fix --build-and-test without --build-target on Xcode cb6c233ecc cmake: Add -hideShellScriptEnvironment xcodebuild option 1a45266cb5 cmGlobalGenerator: Add a class that represent the build command Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2708
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 3ca2b17..dac6ea6 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -495,10 +495,10 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2(
}
void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ 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)
+ int jobs, bool verbose, std::vector<std::string> const& makeOptions)
{
std::unique_ptr<cmMakefile> mfu;
cmMakefile* mf;
@@ -515,17 +515,23 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
mf = mfu.get();
}
- makeCommand.push_back(this->SelectMakeProgram(makeProgram));
+ // Make it possible to set verbosity also from command line
+ if (verbose) {
+ makeCommand.add(cmSystemTools::GetCMakeCommand());
+ makeCommand.add("-E");
+ makeCommand.add("env");
+ makeCommand.add("VERBOSE=1");
+ }
+ makeCommand.add(this->SelectMakeProgram(makeProgram));
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.emplace_back("-j");
+ makeCommand.add("-j");
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back(std::to_string(jobs));
+ makeCommand.add(std::to_string(jobs));
}
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
if (!targetName.empty()) {
std::string tname = targetName;
if (fast) {
@@ -535,7 +541,7 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
mf->GetStateSnapshot().GetDirectory().ConvertToRelPathIfNotContained(
mf->GetState()->GetBinaryDirectory(), tname);
cmSystemTools::ConvertToOutputSlashes(tname);
- makeCommand.push_back(std::move(tname));
+ makeCommand.add(std::move(tname));
}
}