-
Notifications
You must be signed in to change notification settings - Fork 24
/
build_deps.sh
executable file
·68 lines (58 loc) · 2.51 KB
/
build_deps.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
#!/bin/bash
SCRIPT_PATH=$(readlink -f $0)
BASE_DIR=$(dirname $SCRIPT_PATH)
CMAKE_BUILD_TYPE="Release"
DEPS_INSTALL_PATH=$BASE_DIR/deps/out
while [ ! $# -eq 0 ]
do
case "$1" in
--debug)
CMAKE_BUILD_TYPE="Debug"
;;
esac
shift
done
rm -rf ${DEPS_INSTALL_PATH}
mkdir -p ${DEPS_INSTALL_PATH}
# Build flatbuffers
cd $BASE_DIR/deps/flatbuffers && rm -rf build && mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_CXX_STANDARD=11 \
-DFLATBUFFERS_STATIC_FLATC=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF \
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PATH} .. && \
make -j$(nproc) install && \
rm -rf $BASE_DIR/deps/flatbuffers/build
# Build yaml-cpp
cd $BASE_DIR/deps/yaml-cpp && rm -rf build && mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DYAML_CPP_BUILD_TESTS=OFF -DCMAKE_CXX_STANDARD=11 \
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PATH} .. && \
make -j$(nproc) install && \
rm -rf $BASE_DIR/deps/yaml-cpp/build
# Build json
cd $BASE_DIR/deps/json && rm -rf build && mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DJSON_BuildTests=OFF -DCMAKE_CXX_STANDARD=11 \
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PATH} .. && \
make -j$(nproc) install && \
rm -rf $BASE_DIR/deps/json/build
# Build abseil-cpp
cd $BASE_DIR/deps/abseil-cpp && rm -rf build && mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_STANDARD=11 \
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PATH} .. && \
make -j$(nproc) install && \
rm -rf $BASE_DIR/deps/abseil-cpp/build
# Build http-parser
cd $BASE_DIR/deps/http-parser && make clean && make package && \
install -D $BASE_DIR/deps/http-parser/http_parser.h $DEPS_INSTALL_PATH/include/http_parser.h && \
install -D $BASE_DIR/deps/http-parser/libhttp_parser.a $DEPS_INSTALL_PATH/lib/libhttp_parser.a && \
make clean
# Build glog
cd $BASE_DIR/deps/glog && rm -rf build && mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DWITH_GFLAGS=OFF -DCMAKE_CXX_STANDARD=11 \
-DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PATH} .. && \
make -j$(nproc) install && \
rm -rf $BASE_DIR/deps/glog/build
# Build libuv
cd $BASE_DIR/deps/libuv && rm -rf build && mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DLIBUV_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PATH} .. && \
make -j$(nproc) install && \
rm -rf $BASE_DIR/deps/libuv/build