代码拉取完成,页面将自动刷新
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。