-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild
executable file
·106 lines (89 loc) · 1.69 KB
/
build
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env bash
set -eo pipefail
cd $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
out_dir=.bin
thread_count=8
if [[ $OSTYPE == 'darwin'* ]]; then
thread_count=$(sysctl -n hw.logicalcpu)
else
thread_count=$(nproc --all)
fi
debug_args=(
"-o:speed"
)
extra_args=()
lite=
ios=
iphonesim=
while true; do
case $1 in
-j)
shift && thread_count=$1 || exit 1
;;
-debug)
debug_args=(
"-o:none"
"-debug"
#"-show-debug-messages"
"-show-system-calls"
-show-more-timings
-keep-temp-files
# -use-separate-modules
)
;;
-lite)
lite=1
;;
-l)
lite=1
;;
-ios)
ios=1
;;
-iphonesim)
iphonesim=1
;;
-timings)
extra_args+=(-show-more-timings)
;;
-out)
shift && out_dir=$1 || exit 1
;;
esac
shift || break
done
root='.'
if [[ ${lite} -eq 1 ]]; then
root="./darwodin-macos-lite"
else
root="./darwodin-macos"
fi
if [[ "${ios}" -eq 1 ]] || [[ "${iphonesim}" -eq 1 ]]; then
root="./darwodin-ios"
if [[ "${ios}" -eq 1 ]]; then
extra_args+=(-subtarget:ios)
else
extra_args+=(-subtarget:ios-simulator)
fi
if [[ ${lite} -eq 1 ]]; then
root="./darwodin-ios-lite"
fi
fi
mkdir -p "${out_dir}"
TIMEFORMAT='Build Time: %R seconds'
set -x
time {
odin build samples/metal_app \
"-collection:samples=./samples" \
"-collection:root=${root}" \
"-out:${out_dir}/main" \
"-minimum-os-version:17.04" \
${debug_args[@]} \
-thread-count:${thread_count} \
-target:darwin_arm64 \
${extra_args[@]}
}
set +x
if [[ "${ios}" -eq 1 ]] || [[ "${iphonesim}" -eq 1 ]]; then
./make-ios-app
fi