-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdeps.sh
More file actions
executable file
·63 lines (52 loc) · 1.68 KB
/
deps.sh
File metadata and controls
executable file
·63 lines (52 loc) · 1.68 KB
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
#!/usr/bin/env bash
set -euo pipefail
# Install prefix
PREFIX="$(pwd)/opt"
install_flatbuffers () {
mkdir -p "$PREFIX/build/flatbuffers"
echo "[+] Configuring flatbuffers (flatc only)"
cmake \
-S shlr/flatbuffers \
-B "$PREFIX/build/flatbuffers" \
-G"Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH="$PREFIX" \
-DFLATBUFFERS_BUILD_TESTS=OFF \
-DFLATBUFFERS_BUILD_FLATC=ON \
-DFLATBUFFERS_BUILD_FLATLIB=OFF
echo "[+] Building flatc binary only"
make -C "$PREFIX/build/flatbuffers" flatc -j `nproc`
echo "[+] Installing flatc via cmake"
cmake --install "$PREFIX/build/flatbuffers" --config Release
echo "[+] Successfully installed flatc"
}
install_protobuf () {
mkdir -p "$PREFIX/build/protobuf"
# Note: insane CMAKE_CXX_LINK_EXECUTABLE required to link with custom libc++
echo "[+] Configuring protobuf"
cmake \
-S shlr/protobuf \
-B "$PREFIX/build/protobuf" \
-G"Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH="$PREFIX" \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DABSL_PROPAGATE_CXX_STD=ON \
-DBUILD_TESTING=OFF \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_BUILD_CONFORMANCE=OFF \
-Dprotobuf_BUILD_EXAMPLES=OFF \
-Dprotobuf_BUILD_PROTOBUF_BINARIES=ON \
-Dprotobuf_BUILD_PROTOC_BINARIES=ON \
-Dprotobuf_BUILD_LIBPROTOC=ON \
-Dprotobuf_BUILD_SHARED_LIBS=OFF \
-Dprotobuf_INSTALL=ON
echo "[+] Building protobuf"
make -C "$PREFIX/build/protobuf" -j `nproc`
echo "[+] Installing protobuf"
make -C "$PREFIX/build/protobuf" install -j `nproc`
echo "[+] Successfully installed protobuf"
}
mkdir -pv "$PREFIX"
install_flatbuffers
install_protobuf