build: fix Intel macOS build

Fix the Intel build for the macOS builder.

Disable tests for the fmt dist because they do not compile for Intel.

Use the XCode `libclang_rt.osx.a` when not using the Nix clang on ARM64.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover
2025-10-04 03:33:43 -07:00
parent 6e20fdc2e3
commit cb5689b216
2 changed files with 12 additions and 5 deletions

View File

@@ -403,6 +403,7 @@ DIST_ARGS="$DIST_ARGS
libx264 --enable-static --enable-pic
libwebp -DCMAKE_EXE_LINKER_FLAGS=\"-lutil\"
libx265 -DHIGH_BIT_DEPTH=ON -DENABLE_ASSEMBLY=OFF -DENABLE_CLI=OFF
fmt -DFMT_TEST=OFF
wxwidgets -DwxUSE_LIBJPEG=sys -DwxUSE_LIBPNG=sys -DwxUSE_LIBTIFF=sys -DwxUSE_LIBWEBP=sys -DwxUSE_REGEX=sys
"

View File

@@ -116,11 +116,17 @@ best_llvm_path=$(
# Fallback to XCode version.
[ -z "$best_llvm_path" ] && best_llvm_path=/usr
case "$best_llvm_path" in
/nix/store/*) # Nix
rt_lib=$(find /nix/store -maxdepth 1 -type d -name '*-compiler-rt-libc-*[0-9]' | while read -r d; do echo $d $(echo $d | sed -E 's/.*-([0-9.]+)$/\1/'); done | sort -V -k 2 | tail -n 1 | awk '{ print $1 }')/lib/libclang_rt.osx.a
;;
esac
if [ -n "$APPLE_SILICON" ] && [ -z "$intel_target" ]; then
case "$best_llvm_path" in
/nix/store/*) # Nix
rt_lib=$(find /nix/store -maxdepth 1 -type d -name '*-compiler-rt-libc-*[0-9]' | while read -r d; do echo $d $(echo $d | sed -E 's/.*-([0-9.]+)$/\1/'); done | sort -V -k 2 | tail -n 1 | awk '{ print $1 }')/lib/libclang_rt.osx.a
;;
esac
fi
if [ -z "$rt_lib" ]; then
rt_lib=$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/"$(/usr/bin/clang --version | head -1 | awk '{ print $4 }')"/lib/darwin/libclang_rt.osx.a
fi
clang_path=${best_llvm_path%%:*}
xcode_path=$(xcode-select -p)