Ai
1 Star 0 Fork 0

mindbox/xloop

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
run.sh 3.86 KB
一键复制 编辑 原始数据 按行查看 历史
mindbox 提交于 2025-12-05 19:39 +08:00 . last version
#!/bin/sh
os=$(uname -s)
if [[ "$os" == "Darwin" ]]; then
host_tag="darwin-x86_64"
elif [[ "$os" == "CYGWIN"* ]]; then
host_tag="windows-x86_64"
else
host_tag="linux-x86_64"
fi
PROJECT=xloop_basic
RUNNER_DIR=../../runner
TARGET_DIR=../../
if [[ "$1" = "ios" ]]; then
PROFILE=dev
PROFILE_DIR=debug
cargo build \
--target aarch64-apple-ios \
-p $PROJECT \
--profile $PROFILE \
--example ios
cargo build \
--target x86_64-apple-ios \
-p $PROJECT \
--profile $PROFILE \
--example ios
lipo -create -output $RUNNER_DIR/ios/mudx/libmudx.a \
$TARGET_DIR/target/x86_64-apple-ios/$PROFILE_DIR/examples/libios.a \
$TARGET_DIR/target/aarch64-apple-ios/$PROFILE_DIR/examples/libios.a
lipo -archs $RUNNER_DIR/ios/mudx/libmudx.a
fi
if [[ "$1" = "iosapp" ]]; then
PROFILE=release
PROFILE_DIR=release
# PROFILE=dev
# PROFILE_DIR=debug
TARGET=aarch64-apple-ios
cargo build --target $TARGET -p $PROJECT --profile $PROFILE
cp $TARGET_DIR/target/$TARGET/$PROFILE_DIR/$PROJECT $RUNNER_DIR/ios.app/xloop
# xcrun simctl boot "iPhone 16 Pro"
# open -a Simulator
# xcrun simctl install booted $RUNNER_DIR/ios.app/
# xcrun simctl launch --console booted com.mindbox.xloop
fi
if [[ "$1" = "mac" ]]; then
PROFILE=dev
PROFILE_DIR=debug
cargo build \
--target aarch64-apple-darwin \
--profile $PROFILE \
-p $PROJECT \
--example macos
cargo build \
--target x86_64-apple-darwin \
--profile $PROFILE \
-p $PROJECT \
--example macos
lipo -create -output $RUNNER_DIR/macos/mudx/libmudx.a \
$TARGET_DIR/target/x86_64-apple-darwin/$PROFILE_DIR/examples/libmacos.a \
$TARGET_DIR/target/aarch64-apple-darwin/$PROFILE_DIR/examples/libmacos.a
lipo -archs $RUNNER_DIR/macos/mudx/libmudx.a
fi
if [[ "$1" = "macapp" ]]; then
PROFILE=release
PROFILE_DIR=release
TARGET=aarch64-apple-darwin
cargo build \
--target $TARGET \
--profile $PROFILE \
-p $PROJECT \
mkdir $RUNNER_DIR/mac.app/Contents/MacOs
cp $TARGET_DIR/target/$TARGET/$PROFILE_DIR/$PROJECT \
$RUNNER_DIR/mac.app/Contents/MacOs/mudx
open $RUNNER_DIR/mac.app
fi
if [[ "$1" = "win" ]]; then
PROFILE=dev
PROFILE_DIR=debug
TARGET=x86_64-pc-windows-gnu
cargo build -p $PROJECT --profile $PROFILE --target $TARGET
cp $TARGET_DIR/target/x86_64-pc-windows-gnu/$PROFILE_DIR/$PROJECT.exe $RUNNER_DIR/windows/$PROJECT.exe
wine $RUNNER_DIR/windows/$PROJECT.exe
fi
if [[ "$1" = "gnu" ]]; then
# PROFILE=dev
# PROFILE_DIR=debug
PROFILE=release
PROFILE_DIR=release
TARGET=aarch64-unknown-linux-gnu
# cargo build -p $PROJECT --profile $PROFILE --target $TARGET
# cp $TARGET_DIR/target/x86_64-pc-windows-gnu/$PROFILE_DIR/$PROJECT.exe $RUNNER_DIR/windows/$PROJECT.exe
# wine $RUNNER_DIR/windows/$PROJECT.exe
# docker run --rm -it \
# -v $(pwd)/../../:/project \
# -v $HOME/.cargo/registry:/cargo/registry \
# -v $HOME/.cargo/git:/cargo/git \
# -w /project \
# ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main \
# /bin/bash
fi
if [[ "$1" = "ndk" ]]; then
PROFILE=dev
PROFILE_DIR=debug
TARGET=aarch64-linux-android
cargo build --profile $PROFILE --target $TARGET -p $PROJECT --example android
cp $TARGET_DIR/target/$TARGET/$PROFILE_DIR/examples/libandroid.so \
$RUNNER_DIR/android/app/src/main/jniLibs/arm64-v8a/libxloop.so
# TARGET=x86_64-linux-android
# cargo build --profile $PROFILE --target $TARGET -p $PROJECT --example android
# cp $TARGET_DIR/target/$TARGET/$PROFILE_DIR/examples/libandroid.so \
# $RUNNER_DIR/android/app/src/main/jniLibs/x86_64/libxloop.so
fi
if [[ "$1" = "avd" ]]; then
emulator @Api33 -gpu host
fi
if [[ "$1" = "web" ]]; then
PROFILE=release
PROFILE_DIR=release
TARGET=wasm32-unknown-unknown
cargo build \
--profile $PROFILE \
--target $TARGET \
-p $PROJECT \
--example web
wasm-bindgen --target web --no-typescript --omit-default-module-path \
--out-dir $RUNNER_DIR/web/ \
--out-name xloop \
$TARGET_DIR/target/$TARGET/$PROFILE_DIR/examples/web.wasm
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mindbox/xloop.git
git@gitee.com:mindbox/xloop.git
mindbox
xloop
xloop
master

搜索帮助