mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-05-05 10:12:56 +00:00
xcf : use check for visionos build version (#3021)
This commit adds a check for the visionos build version used with vtool in build-xcframework.sh. The script now checks the Xcode version and determines whether to use "xros" or "visionos" for the build version. This commit also uses xcrun for the vtool so that the version of vtool in xcode command line tools is used instead of the one in the system path. Refs: https://github.com/ggml-org/whisper.cpp/pull/2994#issuecomment-2773292223
This commit is contained in:
parent
ef6cf357e7
commit
cf794133de
@ -41,6 +41,11 @@ COMMON_CMAKE_ARGS=(
|
|||||||
-DGGML_OPENMP=${GGML_OPENMP}
|
-DGGML_OPENMP=${GGML_OPENMP}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
XCODE_VERSION=$(xcodebuild -version 2>/dev/null | head -n1 | awk '{ print $2 }')
|
||||||
|
MAJOR_VERSION=$(echo $XCODE_VERSION | cut -d. -f1)
|
||||||
|
MINOR_VERSION=$(echo $XCODE_VERSION | cut -d. -f2)
|
||||||
|
echo "Detected Xcode version: $XCODE_VERSION"
|
||||||
|
|
||||||
check_required_tool() {
|
check_required_tool() {
|
||||||
local tool=$1
|
local tool=$1
|
||||||
local install_message=$2
|
local install_message=$2
|
||||||
@ -335,21 +340,28 @@ combine_static_libraries() {
|
|||||||
|
|
||||||
# Platform-specific post-processing for device builds
|
# Platform-specific post-processing for device builds
|
||||||
if [[ "$is_simulator" == "false" ]]; then
|
if [[ "$is_simulator" == "false" ]]; then
|
||||||
if command -v vtool &>/dev/null; then
|
if command -v xcrun vtool &>/dev/null; then
|
||||||
case "$platform" in
|
case "$platform" in
|
||||||
"ios")
|
"ios")
|
||||||
echo "Marking binary as a framework binary for iOS..."
|
echo "Marking binary as a framework binary for iOS..."
|
||||||
vtool -set-build-version ios ${IOS_MIN_OS_VERSION} ${IOS_MIN_OS_VERSION} -replace \
|
xcrun vtool -set-build-version ios ${IOS_MIN_OS_VERSION} ${IOS_MIN_OS_VERSION} -replace \
|
||||||
-output "${base_dir}/${output_lib}" "${base_dir}/${output_lib}"
|
-output "${base_dir}/${output_lib}" "${base_dir}/${output_lib}"
|
||||||
;;
|
;;
|
||||||
"visionos")
|
"visionos")
|
||||||
echo "Marking binary as a framework binary for visionOS..."
|
echo "Marking binary as a framework binary for visionOS..."
|
||||||
vtool -set-build-version xros ${VISIONOS_MIN_OS_VERSION} ${VISIONOS_MIN_OS_VERSION} -replace \
|
if [[ "$MAJOR_VERSION" -gt 16 ]] || [[ "$MAJOR_VERSION" -eq 16 && "$MINOR_VERSION" -gt 2 ]]; then
|
||||||
|
echo "Xcode version greater than 16.2, using visionOS."
|
||||||
|
VISION_OS_BUILD_VERSION="visionos"
|
||||||
|
else
|
||||||
|
echo "Xcode version less than or equal to 16.2, using xros."
|
||||||
|
VISION_OS_BUILD_VERSION="xros"
|
||||||
|
fi
|
||||||
|
xcrun vtool -set-build-version ${VISION_OS_BUILD_VERSION} ${VISIONOS_MIN_OS_VERSION} ${VISIONOS_MIN_OS_VERSION} -replace \
|
||||||
-output "${base_dir}/${output_lib}" "${base_dir}/${output_lib}"
|
-output "${base_dir}/${output_lib}" "${base_dir}/${output_lib}"
|
||||||
;;
|
;;
|
||||||
"tvos")
|
"tvos")
|
||||||
echo "Marking binary as a framework binary for tvOS..."
|
echo "Marking binary as a framework binary for tvOS..."
|
||||||
vtool -set-build-version tvos ${TVOS_MIN_OS_VERSION} ${TVOS_MIN_OS_VERSION} -replace \
|
xcrun vtool -set-build-version tvos ${TVOS_MIN_OS_VERSION} ${TVOS_MIN_OS_VERSION} -replace \
|
||||||
-output "${base_dir}/${output_lib}" "${base_dir}/${output_lib}"
|
-output "${base_dir}/${output_lib}" "${base_dir}/${output_lib}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user