-
Notifications
You must be signed in to change notification settings - Fork 31
/
ninja_build.sh
50 lines (43 loc) · 1.54 KB
/
ninja_build.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
50
#!/bin/bash
set -e
RED='\033[0;31m'
NOCOLOR='\033[0m'
if [[ $(uname -m) == "arm64" ]]; then
echo "Host: arm64"
GN_SIM_ARGS="--simulator-cpu=arm64"
GN_ARGS="--mac-cpu=arm64"
OUTPUT_POSTFIX="_arm64"
else
echo "Host: x64"
GN_SIM_ARGS=""
GN_ARGS=""
OUTPUT_POSTFIX=""
fi
if [[ "$1" == "clean" ]]; then
echo "Clean build ..."
rm -irf ./out/ios_debug_sim_unopt$OUTPUT_POSTFIX
rm -rf ./out/ios_debug_unopt$OUTPUT_POSTFIX
rm -rf ./out/ios_release$OUTPUT_POSTFIX
rm -rf ./out/host_debug_unopt$OUTPUT_POSTFIX
rm -rf ./out/host_release$OUTPUT_POSTFIX
fi
if [[ "$1" == "clean" ]] || [[ ! -d ./out/ios_debug_sim_unopt$OUTPUT_POSTFIX ]]; then
./flutter/tools/gn --ios --no-goma --simulator --unoptimized $GN_SIM_ARGS
fi
ninja -C out/ios_debug_sim_unopt$OUTPUT_POSTFIX
if [[ "$1" == "clean" ]] || [[ ! -d ./out/ios_debug_unopt$OUTPUT_POSTFIX ]]; then
./flutter/tools/gn --ios --no-goma --unoptimized $GN_ARGS
fi
ninja -C out/ios_debug_unopt$OUTPUT_POSTFIX
if [[ "$1" == "clean" ]] || [[ ! -d ./out/ios_release$OUTPUT_POSTFIX ]]; then
./flutter/tools/gn --ios --no-goma --runtime-mode=release $GN_ARGS
fi
ninja -C out/ios_release$OUTPUT_POSTFIX
if [[ "$1" == "clean" ]] || [[ ! -d ./out/host_debug_unopt$OUTPUT_POSTFIX ]]; then
./flutter/tools/gn --no-goma --unoptimized --no-prebuilt-dart-sdk $GN_ARGS
fi
ninja -C out/host_debug_unopt$OUTPUT_POSTFIX
if [[ "$1" == "clean" ]] || [[ ! -d ./out/host_release$OUTPUT_POSTFIX ]]; then
./flutter/tools/gn --no-goma --no-lto --runtime-mode=release --no-prebuilt-dart-sdk $GN_ARGS
fi
ninja -C out/host_release$OUTPUT_POSTFIX