Skip to content

Commit f832a99

Browse files
committed
[Build script] Fix debug messages
Remove debug messages. There are still possible misuse of script as options without "-" in the start will be ignored.
1 parent a971bff commit f832a99

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

scripts/compile.sh

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
repo=intel/graph-compiler
44

55
# Uncomment for script debug
6-
# set -ex
6+
# set -x
77

88
function print_usage() {
99
echo "Usage:"
@@ -13,34 +13,27 @@ function print_usage() {
1313
echo " [ -h | --help ] Print this message"
1414
}
1515

16-
args=$(getopt -a -o dlh --long dev,dyn,help -- "$@")
17-
if [[ $? -gt 0 ]]; then
18-
echo "first"
19-
print_usage
20-
fi
21-
2216
DEV_BUILD=false
2317
DYN_LINK=false
24-
eval set -- ${args}
25-
while :
26-
do
27-
case $1 in
18+
for arg in "$@"; do
19+
case $arg in
2820
-d | --dev)
2921
DEV_BUILD=true
30-
shift ;;
22+
;;
3123
-l | --dyn)
3224
DEV_BUILD=true
3325
DYN_LINK=true
34-
shift ;;
26+
;;
3527
-h | --help)
36-
echo "in help"
3728
print_usage
38-
shift ;;
29+
exit 0
30+
;;
3931
# -- means the end of the arguments; drop this, and break out of the while loop
40-
--) shift; break ;;
41-
*) >&2 echo Unsupported option: $1
42-
echo "in unsup"
43-
print_usage ;;
32+
*)
33+
echo Unsupported option: $arg
34+
print_usage
35+
exit 1
36+
;;
4437
esac
4538
done
4639

@@ -132,6 +125,7 @@ fi
132125
if [ -z "$lit_path" ]; then
133126
echo "========Warning======="
134127
echo " Lit not found. "
128+
echo "======================"
135129
fi
136130

137131
cmake -S . -G Ninja -B build \
@@ -140,4 +134,5 @@ cmake -S . -G Ninja -B build \
140134
-DLLVM_EXTERNAL_LIT=$lit_path \
141135
-DFETCHCONTENT_BASE_DIR=$fetch_dir \
142136
-DGC_DEV_LINK_LLVM_DYLIB=$dylib
137+
143138
cmake --build build --parallel $(nproc)

0 commit comments

Comments
 (0)