-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathbuild.sh
executable file
·69 lines (61 loc) · 828 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
CC=gcc
LD=gcc
BUILD_TYPE=Debug
EIO=
CFLAGS=
for i in "$@"
do
case $i in
clang)
CC=clang
LD=clang
;;
gcc)
CC=gcc
LD=gcc
;;
deb*)
BUILD_TYPE=Debug
;;
rel*)
BUILD_TYPE=RelWithDebInfo
;;
+eio)
EIO="-DWANT_EIO=TRUE"
;;
+valgrind)
VALGRIND="-DWANT_VALGRIND=TRUE"
;;
+eioe)
EIO="-DWANT_EIO=TRUE -DWANT_EMBEDDED_EIO=TRUE"
;;
-eio)
EIO="-DWANT_EIO=FALSE"
;;
cov*)
CC=gcc
LD=gcc
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
;;
*)
echo "Unknown option: $i"
exit
;;
esac
done
if [ -d build ] ; then
rm -rf build
fi
mkdir build
pushd build
export LD
export CC
export CFLAGS
echo cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE $EIO $VALGRIND ..
echo
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE $EIO $VALGRIND ..
echo
make
echo
popd