mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 13:51:33 -06:00
XCode: Use -j build option when job capacity is specified by user
Fixes: #18304
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -201,8 +201,8 @@ function(run_BuildDir)
|
||||
run_cmake_command(BuildDir--build--parallel-large ${CMAKE_COMMAND} -E chdir ..
|
||||
${CMAKE_COMMAND} --build BuildDir-build --parallel 4294967293)
|
||||
|
||||
# No default jobs for Xcode and FreeBSD build command
|
||||
if(NOT RunCMake_GENERATOR MATCHES "Xcode" AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
# No default jobs for FreeBSD build command
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
run_cmake_command(BuildDir--build-jobs-no-number ${CMAKE_COMMAND} -E chdir ..
|
||||
${CMAKE_COMMAND} --build BuildDir-build -j)
|
||||
run_cmake_command(BuildDir--build-jobs-no-number-trailing--target ${CMAKE_COMMAND} -E chdir ..
|
||||
|
||||
Reference in New Issue
Block a user