-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·22 lines (20 loc) · 831 Bytes
/
build.sh
File metadata and controls
executable file
·22 lines (20 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
# Check for required dependencies
for pkg in pkg-config protobuf-compiler protobuf-c-compiler libprotobuf-dev libprotobuf-c-dev libncurses-dev; do
if ! dpkg -s "$pkg" >/dev/null 2>&1; then
echo "Error: Required package $pkg is not installed.\nPlease install the dependencies and try again:\n sudo apt install pkg-config protobuf-compiler protobuf-c-compiler libprotobuf-dev libprotobuf-c-dev libncurses-dev" >&2
exit 1
fi
done
if [ $# -eq 0 ]; then
cmake -S . -B build
cmake --build build --target client
cmake --build build --target server
cmake --build build --target test-client
elif [ "$1" = "client" ] || [ "$1" = "server" ] || [ "$1" = "test-client" ]; then
cmake -S . -B build
cmake --build build --target "$1"
else
echo "Usage: $0 [client|server|test-client]"
exit 1
fi