File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
xcodeproj/internal/templates Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -97,19 +97,23 @@ readonly base_pre_config_flags=(
9797# Custom Swift toolchains
9898
9999if [[ -n " ${TOOLCHAINS-} " ]]; then
100- toolchain=" ${TOOLCHAINS%% * } "
101- if [[ " $toolchain " == " com.apple.dt.toolchain.XcodeDefault" ]]; then
102- unset toolchain
100+ # We remove all Metal toolchains from the list first
101+ toolchains_array=($TOOLCHAINS )
102+ filtered_toolchains=()
103+ for tc in " ${toolchains_array[@]} " ; do
104+ if [[ " $tc " != * " com.apple.dt.toolchain.Metal" * ]]; then
105+ filtered_toolchains+=(" $tc " )
106+ fi
107+ done
108+
109+ if [[ ${# filtered_toolchains[@]} -gt 0 ]]; then
110+ toolchain=" ${filtered_toolchains[0]} "
111+ if [[ " $toolchain " == " com.apple.dt.toolchain.XcodeDefault" ]]; then
112+ unset toolchain
113+ fi
103114 fi
104115fi
105116
106- # We unset Metal toolchains since Xcode 26+ complains when that's passed as action_env
107- # Older Xcode versions don't seem to populate this variable with Metal toolchain
108- # This is why there is no version check
109- if [[ " ${toolchain:- } " == * " com.apple.dt.toolchain.Metal" * ]]; then
110- unset toolchain
111- fi
112-
113117# Build
114118
115119echo " Starting Bazel build"
You can’t perform that action at this time.
0 commit comments