-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_debug.sh
executable file
·55 lines (48 loc) · 999 Bytes
/
build_debug.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
51
52
53
54
55
#!/usr/bin/env bash
set -eux
set -o pipefail
CURRENT_DIR=$(cd $(dirname $0); pwd)
CPU_PROCESSOR_NUM=$(grep processor /proc/cpuinfo | wc -l)
JOB_NUM=$(expr "${CPU_PROCESSOR_NUM}")
function build()
{
rm -rf build/
mkdir build
cd build
cmake -DDOWNLOAD_THIRDPARTY=false -DCMAKE_VERBOSE_MAKEFILE=on -DCMAKE_BUILD_TYPE=Debug ..
make -j${JOB_NUM} && make install
cd ${CURRENT_DIR}
}
function deps()
{
rm -rf build/
mkdir build
cd build
cmake -DDOWNLOAD_THIRDPARTY=true -DCMAKE_VERBOSE_MAKEFILE=on -DCMAKE_BUILD_TYPE=Debug ..
make -j${JOB_NUM}
cd ${CURRENT_DIR}
}
function all()
{
deps
build
}
function usage()
{
echo "./build_debug.sh [-deps|-build|-all]"
echo "-deps for download third party"
echo "-build for build and install this project"
echo "-all for build and install deps and this project"
}
if [ $1 = "-deps" ]
then
deps
elif [ $1 = "-build" ]
then
build
elif [ $1 = "-all" ]
then
all
else
usage
fi