Skip to content

Commit 7230660

Browse files
committed
Add a simple argument parser to build.sh
1 parent 44c0204 commit 7230660

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

build.sh

+17-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
#set -x
44
set -e
55

6+
codegen_channel=debug
7+
8+
while [[ $# -gt 0 ]]; do
9+
case $1 in
10+
--release)
11+
codegen_channel=release
12+
shift
13+
;;
14+
*)
15+
echo "Unknown option $1"
16+
exit 1
17+
;;
18+
esac
19+
done
20+
621
if [ -f ./gcc_path ]; then
722
export GCC_PATH=$(cat gcc_path)
823
else
@@ -21,7 +36,7 @@ if [[ "$1" == "--features" ]]; then
2136
shift
2237
fi
2338

24-
if [[ "$1" == "--release" ]]; then
39+
if [[ "$codegen_channel" == "release" ]]; then
2540
export CHANNEL='release'
2641
CARGO_INCREMENTAL=1 cargo rustc --release $features
2742
else
@@ -37,3 +52,4 @@ mkdir -p target/out/gccjit
3752

3853
echo "[BUILD] sysroot"
3954
time ./build_sysroot/build_sysroot.sh $CHANNEL
55+

0 commit comments

Comments
 (0)