Use xcode parallel build flags to speed up iOS CI that is timing out (#19570)

### Description
<!-- Describe your changes. -->
Provide specific xcodebuild flags instead of depending on cmake to do
the right thing.

This built in just over an hour with a ccache miss. Previous CIs with a
ccache miss were timing out after 150 minutes.


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
This commit is contained in:
Scott McKay 2024-02-21 07:40:35 +10:00 committed by GitHub
parent 3c49aacd56
commit ec9c8cbdc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1631,9 +1631,11 @@ def generate_build_tree(
[
*temp_cmake_args,
f"-DCMAKE_BUILD_TYPE={config}",
f"-DCMAKE_PREFIX_PATH={build_dir}/{config}/installed"
if preinstalled_dir.exists() and not (args.arm64 or args.arm64ec or args.arm)
else "",
(
f"-DCMAKE_PREFIX_PATH={build_dir}/{config}/installed"
if preinstalled_dir.exists() and not (args.arm64 or args.arm64ec or args.arm)
else ""
),
],
cwd=config_build_dir,
cuda_home=cuda_home,
@ -1667,8 +1669,11 @@ def build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, targe
f"/p:CL_MPCount={num_parallel_jobs}",
]
elif args.cmake_generator == "Xcode":
# CMake will generate correct build tool args for Xcode
cmd_args += ["--parallel", str(num_parallel_jobs)]
build_tool_args += [
"-parallelizeTargets",
"-jobs",
str(num_parallel_jobs),
]
else:
build_tool_args += [f"-j{num_parallel_jobs}"]