-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·56 lines (44 loc) · 1.07 KB
/
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
51
52
53
#!/bin/bash
## voxl-cross contains the following toolchains
## first two for apq8096, last for qrb5165
TOOLCHAIN_APQ8096_32="/opt/cross_toolchain/arm-gnueabi-4.9.toolchain.cmake"
TOOLCHAIN_APQ8096_64="/opt/cross_toolchain/aarch64-gnu-4.9.toolchain.cmake"
TOOLCHAIN_QRB5165="/opt/cross_toolchain/aarch64-gnu-7.toolchain.cmake"
# placeholder in case more cmake opts need to be added later
EXTRA_OPTS=""
## this list is just for tab-completion
AVAILABLE_PLATFORMS="qrb5165 native"
print_usage(){
echo ""
echo " Build the current project based on platform target."
echo ""
echo " Usage:"
echo ""
echo " ./build.sh qrb5165"
echo " Build 64-bit binaries for qrb5165"
echo ""
echo " ./build.sh native"
echo " Build with the native gcc/g++ compilers."
echo ""
echo ""
}
case "$1" in
qrb5165)
mkdir -p build64
cd build64
cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_QRB5165} ${EXTRA_OPTS} ../
make -j$(nproc)
cd ../
;;
native)
mkdir -p build
cd build
cmake ${EXTRA_OPTS} ../
make -j$(nproc)
cd ../
;;
*)
print_usage
exit 1
;;
esac