summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.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/cmGlobalXCodeGenerator.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/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx43
1 files changed, 19 insertions, 24 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 35a09a7..6d15b8c 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -339,20 +339,22 @@ bool cmGlobalXCodeGenerator::Open(const std::string& bindir,
}
void cmGlobalXCodeGenerator::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)
{
// now build the test
- makeCommand.emplace_back(
+ makeCommand.add(
this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand()));
- makeCommand.emplace_back("-project");
- std::string projectArg = projectName;
- projectArg += ".xcode";
- projectArg += "proj";
- makeCommand.emplace_back(projectArg);
+ if (!projectName.empty()) {
+ makeCommand.add("-project");
+ std::string projectArg = projectName;
+ projectArg += ".xcode";
+ projectArg += "proj";
+ makeCommand.add(projectArg);
+ }
bool clean = false;
std::string realTarget = targetName;
@@ -360,29 +362,22 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand(
clean = true;
realTarget = "ALL_BUILD";
}
- if (clean) {
- makeCommand.emplace_back("clean");
- } else {
- makeCommand.emplace_back("build");
- }
- makeCommand.emplace_back("-target");
- if (!realTarget.empty()) {
- makeCommand.emplace_back(realTarget);
- } else {
- makeCommand.emplace_back("ALL_BUILD");
- }
- makeCommand.emplace_back("-configuration");
- makeCommand.emplace_back(!config.empty() ? config : "Debug");
+
+ makeCommand.add((clean ? "clean" : "build"));
+ makeCommand.add("-target", (realTarget.empty() ? "ALL_BUILD" : realTarget));
+ makeCommand.add("-configuration", (config.empty() ? "Debug" : config));
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.emplace_back("-jobs");
+ makeCommand.add("-jobs");
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.emplace_back(std::to_string(jobs));
+ makeCommand.add(std::to_string(jobs));
}
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ if (this->XcodeVersion >= 70) {
+ makeCommand.add("-hideShellScriptEnvironment");
+ }
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
}
///! Create a local generator appropriate to this Global Generator