feat: update install_cli.sh to support --zenzai and improve stability

This commit is contained in:
Miwa / Ensan
2025-04-13 17:27:12 +09:00
parent 2cde22d3e2
commit 5aebb7872e

View File

@ -1,9 +1,27 @@
swift build -c release -Xcxx -xobjective-c++
cp -f .build/release/CliTool /usr/local/bin/anco
#!/bin/bash
set -e
# FIXME: Unfortunately, in order to use zenzai in anco, you will need to build CliTool with xcodebuild
# It is highly desirable to make it work only with `swift build`
# For Xcode 16 or later
# xcodebuild -scheme CliTool -destination "platform=macOS,name=My Mac" -configuration Release
# For Xcode 15 or former
# xcodebuild -scheme CliTool -destination "platform=macOS,name=Any Mac" -configuration Release
USE_ZENZAI=0
# 引数の解析
for arg in "$@"; do
if [ "$arg" = "--zenzai" ]; then
USE_ZENZAI=1
fi
done
if [ "$USE_ZENZAI" -eq 1 ]; then
echo "📦 Building with Zenzai support..."
swift build -c release -Xcxx -xobjective-c++ --traits Zenzai
else
echo "📦 Building..."
# Build
swift build -c release -Xcxx -xobjective-c++
fi
# Copy Required Resources
cp -R .build/release/llama.framework /usr/local/lib/
# add rpath
install_name_tool -add_rpath /usr/local/lib/ .build/release/CliTool
# Install
cp -f .build/release/CliTool /usr/local/bin/anco