-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
37 lines (31 loc) · 829 Bytes
/
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
#!/bin/bash
script_path=$(realpath $(dirname $0))
mkdir -p build_out
rm -rf build_out/*
cd build_out
cmake_version=$(cmake --version | grep "cmake version" | awk '{print $3}')
if [ "$cmake_version" \< "3.19.0" ] ; then
opts=$(python3 $script_path/cmake/util/preset_parse.py $script_path/CMakePresets.json)
echo $opts
cmake .. $opts
else
cmake .. --preset=default
fi
target=package
if [ "$1"x != ""x ]; then target=$1; fi
cmake --build . --target $target -j16
if [ $? -ne 0 ]; then exit 1; fi
if [ $target = "package" ]; then
if test -d ./op_kernel/binary ; then
./cust*.run
if [ $? -ne 0 ]; then exit 1; fi
cmake --build . --target binary -j16
if [ $? -ne 0 ]; then exit 1; fi
cmake --build . --target $target -j16
fi
fi
# for debug
# cd build_out
# make
# cpack
# verbose append -v