-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·50 lines (46 loc) · 958 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
#!/bin/bash
# compilamos rocksdb si no esta presente
if [ ! -f libs/rocksdb/librocksdb.a ]; then
echo "Compilando rocksdb..."
# compilamos rocksdb como libreria estatica
cd libs/rocksdb
PORTABLE=1 make static_lib
# volvemos al dir base
cd ../..
fi
# compilamos gmock y gtest si no estan presentes (mismo bundle)
if [ ! -f libs/gmock/libgmock.a ]; then
echo "Compilando gmock-gtest bundle..."
cd libs/gmock
cmake .
make
# volvemos al dir base
cd ../..
fi
# clean o build
if [ "$1" == "clean" ]; then
echo -n "Limpiando build..."
rm -rf bin
echo "OK"
else
echo -n "Build..."
mkdir -p bin
cd bin
pwd
cmake ..
make
if [ "$?" != 0 ]; then
exit 1
fi
if [ "$1" == "run" ] && [ -f server ]; then
echo "Ejecutando bin/server..."
echo "----------------------------------------------"
shift
./server "$@"
cd ..
elif [ "$1" == "test" ]; then
shift
echo "Ejecutando tests..."
ctest . "$@"
fi
fi