mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 06:55:26 +00:00
feat: add --debug mode
This commit is contained in:
@ -2,26 +2,50 @@
|
||||
set -e
|
||||
|
||||
USE_ZENZAI=0
|
||||
USE_DEBUG=0
|
||||
|
||||
# 引数の解析
|
||||
for arg in "$@"; do
|
||||
if [ "$arg" = "--zenzai" ]; then
|
||||
USE_ZENZAI=1
|
||||
fi
|
||||
if [ "$arg" = "--debug" ]; then
|
||||
echo "⚠️ Debug mode is enabled. This may cause performance issues."
|
||||
USE_DEBUG=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$USE_DEBUG" -eq 1 ]; then
|
||||
CONFIGURATION="debug"
|
||||
else
|
||||
CONFIGURATION="release"
|
||||
fi
|
||||
|
||||
if [ "$USE_ZENZAI" -eq 1 ]; then
|
||||
echo "📦 Building with Zenzai support..."
|
||||
swift build -c release -Xcxx -xobjective-c++ --traits Zenzai
|
||||
swift build -c $CONFIGURATION -Xcxx -xobjective-c++ --traits Zenzai
|
||||
else
|
||||
echo "📦 Building..."
|
||||
# Build
|
||||
swift build -c release -Xcxx -xobjective-c++
|
||||
swift build -c $CONFIGURATION -Xcxx -xobjective-c++
|
||||
fi
|
||||
|
||||
# Copy Required Resources
|
||||
sudo cp -R .build/release/llama.framework /usr/local/lib/
|
||||
sudo cp -R .build/${CONFIGURATION}/llama.framework /usr/local/lib/
|
||||
|
||||
# add rpath
|
||||
install_name_tool -add_rpath /usr/local/lib/ .build/release/CliTool
|
||||
RPATH="/usr/local/lib/"
|
||||
BINARY_PATH=".build/${CONFIGURATION}/CliTool"
|
||||
|
||||
if ! otool -l "$BINARY_PATH" | grep -q "$RPATH"; then
|
||||
install_name_tool -add_rpath "$RPATH" "$BINARY_PATH"
|
||||
else
|
||||
echo "✅ RPATH $RPATH is already present in $BINARY_PATH"
|
||||
fi
|
||||
# if debug mode, codesign is required to execute
|
||||
if [ "$USE_DEBUG" -eq 1 ]; then
|
||||
echo "🔒 Signing the binary for debug mode..."
|
||||
codesign --force --sign - .build/${CONFIGURATION}/CliTool
|
||||
fi
|
||||
|
||||
# Install
|
||||
sudo cp -f .build/release/CliTool /usr/local/bin/anco
|
||||
sudo cp -f .build/${CONFIGURATION}/CliTool /usr/local/bin/anco
|
||||
|
Reference in New Issue
Block a user