File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
project-template-ios/internal Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,22 @@ GEN_MODULEMAP $TARGET_ARCH
5858printf " Generating metadata..."
5959GEN_METADATA $TARGET_ARCH
6060DELETE_SWIFT_MODULES_DIR
61- NS_LD=" ${NS_LD:- " $TOOLCHAIN_DIR /usr/bin/clang" } "
62- # Skip linking if the resolved linker path points to a transient Metal.xctoolchain
63- if [[ " $NS_LD " == * " Metal.xctoolchain" * ]]; then
64- echo " NSLD: Skipping link because NS_LD resolves to a Metal.xctoolchain: $NS_LD "
61+
62+ # Resolve linker: prefer provided NS_LD, otherwise use toolchain clang if present.
63+ DEFAULT_LD=" $TOOLCHAIN_DIR /usr/bin/clang"
64+ if [[ -z " $NS_LD " ]]; then
65+ if [[ -x " $DEFAULT_LD " ]]; then
66+ NS_LD=" $DEFAULT_LD "
67+ else
68+ echo " NSLD: Skipping link because toolchain clang not found: $DEFAULT_LD (TOOLCHAIN_DIR may be missing)."
69+ exit 0
70+ fi
71+ fi
72+
73+ # If NS_LD was explicitly set to the default path but it's missing, skip as well.
74+ if [[ " $NS_LD " == " $DEFAULT_LD " && ! -x " $NS_LD " ]]; then
75+ echo " NSLD: Skipping link because toolchain clang not found: $NS_LD (TOOLCHAIN_DIR may be missing)."
6576 exit 0
6677fi
67- $NS_LD " $@ "
78+
79+ " $NS_LD " " $@ "
You can’t perform that action at this time.
0 commit comments