-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.sh
49 lines (40 loc) · 1.34 KB
/
compile.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
BUILDVARIANT=$1
PLATFORM=$2
RELFLAG=
if [[ "$BUILDVARIANT" != "debug" ]]
then
RELFLAG=--release
fi
set -euvx
# if [[ -n "${DEVELOPER_SDK_DIR:-}" ]]
# then
# # Assume we're in Xcode, which means we're probably cross-compiling.
# # In this case, we need to add an extra library search path for build scripts and proc-macros,
# # which run on the host instead of the target.
# # (macOS Big Sur does not have linkable libraries in /usr/lib/.)
# export LIBRARY_PATH="${DEVELOPER_SDK_DIR}/MacOSX.sdk/usr/lib:${LIBRARY_PATH:-}"
# fi
for arch in $ARCHS_STANDARD
do
case "$arch" in
# x86_64)
# echo "note: Building for macos (x86_64) $RELFLAG"
# $HOME/.cargo/bin/cargo build -p zpu --lib $RELFLAG --target aarch64-apple-darwin
# ;;
arm64)
case "$PLATFORM" in
ios)
echo "note: Building for aarch64-apple-ios $RELFLAG"
$HOME/.cargo/bin/cargo build -p zpu --lib $RELFLAG --target aarch64-apple-ios
;;
macos)
echo "note: Building for aarch64-apple-darwin $RELFLAG"
$HOME/.cargo/bin/cargo build -p zpu --lib $RELFLAG --target aarch64-apple-darwin
;;
esac
;;
esac
done
# cargo build -p zpu --lib --target aarch64-apple-ios
# cargo build -p zpu --lib --target x86_64-apple-darwin