summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorFred Baksik <fdk17@ftml.net>2020-10-26 17:28:54 (GMT)
committerFred Baksik <fdk17@ftml.net>2020-10-26 17:28:54 (GMT)
commite794509faa4ca430072539e0ab5046fca4cd0028 (patch)
tree77ec96504b72cb176d5f95d6b640c37837b61435 /Source/cmGlobalXCodeGenerator.cxx
parentb3f1a292266099865e0896be9fd0d40803bda7e0 (diff)
downloadCMake-e794509faa4ca430072539e0ab5046fca4cd0028.zip
CMake-e794509faa4ca430072539e0ab5046fca4cd0028.tar.gz
CMake-e794509faa4ca430072539e0ab5046fca4cd0028.tar.bz2
XCode: Use -j build option when job capacity is specified by user
Fixes: #18304
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 952a179..c27bafe 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -503,16 +503,15 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
}
}
- if (this->XcodeBuildSystem >= BuildSystem::Twelve) {
+ if ((this->XcodeBuildSystem >= BuildSystem::Twelve) ||
+ (jobs != cmake::NO_BUILD_PARALLEL_LEVEL)) {
makeCommand.Add("-parallelizeTargets");
}
makeCommand.Add("-configuration", (config.empty() ? "Debug" : config));
- if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.Add("-jobs");
- if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.Add(std::to_string(jobs));
- }
+ if ((jobs != cmake::NO_BUILD_PARALLEL_LEVEL) &&
+ (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL)) {
+ makeCommand.Add("-jobs", std::to_string(jobs));
}
if (this->XcodeVersion >= 70) {