#!/usr/bin/env bash echo "$@" >> /tmp/xcrun-$$.log # We could not care less, luckily this always comes first if [[ ${1} == --sdk ]] || [[ ${1} == -sdk ]] || [[ ${1} == sdk ]]; then shift; shift; fi case ${1} in *-find) # The x86_64 native compiler can be used alongside the arm64 cross-compiler. # Since the arm64 compiler can output x86_64 binaries, the following lines # are not necessary. They are left to explain how both compilers can be used. # if [[ ${HOST} =~ arm64.* ]]; then # # This is necessary to compile the cross-compilation tools that Qt # # requires. The arm64 compilation is being done via the `CROSS_COMPILE` # # flag, therefore this script will only expose the SDK version and path. # echo "which x86_64-apple-darwin13.4.0-${2}" >> /tmp/xcrun-$$.log # which x86_64-apple-darwin13.4.0-${2} >> /tmp/xcrun-$$.log # which x86_64-apple-darwin13.4.0-${2} # exit 0 # fi if which ${HOST}-${2} > /dev/null 2>&1; then echo "which ${HOST}-${2}" >> /tmp/xcrun-$$.log which ${HOST}-${2} >> /tmp/xcrun-$$.log which ${HOST}-${2} exit 0 elif which ${2} > /dev/null 2>&1; then echo "which ${2}" >> /tmp/xcrun-$$.log which ${2} >> /tmp/xcrun-$$.log which ${2} exit 0 else echo "ERROR :: Fake xcrun failed to locate ${2}" >> /tmp/xcrun-$$.log echo "ERROR :: Fake xcrun failed to locate ${2}" exit 1 fi ;; *-show-sdk-path) if [[ -n ${CONDA_BUILD_SYSROOT} ]]; then echo ${CONDA_BUILD_SYSROOT} >> /tmp/xcrun-$$.log echo ${CONDA_BUILD_SYSROOT} exit 0 fi if [[ -f /usr/bin/xcrun ]]; then /usr/bin/xcrun --sdk macosx --show-sdk-path exit $? fi echo "TODO :: Implement fallback for xcrun --show-sdk-path" exit 1 ;; *-show-sdk-version) if [[ ${HOST} =~ arm64.* ]]; then echo 11.0 else echo 10.14 fi exit 0 ;; *-show-sdk-platform-path) echo /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform exit 0 ;; *-show-sdk-build-version) if [[ ${HOST} =~ arm64.* ]]; then echo 20A2408 else echo 18G74 fi exit 0 ;; esac if [[ -n ${HOST} ]] && [[ -f ${HOST}-${1} ]]; then echo "calling ${HOST}-$@" >> /tmp/xcrun-$$.log ${HOST}-"$@" else echo "calling $@" >> /tmp/xcrun-$$.log "$@" fi