-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·44 lines (40 loc) · 1.07 KB
/
build.sh
File metadata and controls
executable file
·44 lines (40 loc) · 1.07 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
#!/bin/bash
echo "======================================"
echo " R-Type Build Script"
echo "======================================"
echo ""
# Check if CPM is already installed
if [ ! -f "cmake/CPM.cmake" ]; then
echo "CPM not found. Downloading..."
mkdir -p cmake
wget -q -O cmake/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/CPM.cmake
if [ $? -eq 0 ]; then
echo "CPM installed successfully."
else
echo "Failed to download CPM. Please check your internet connection."
exit 1
fi
else
echo "CPM found."
fi
echo ""
echo "Configuring project..."
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -B build
if [ $? -ne 0 ]; then
echo "CMake configuration failed!"
exit 1
fi
echo ""
echo "Building..."
cmake --build build -j$(nproc)
if [ $? -eq 0 ]; then
echo ""
echo "======================================"
echo " Build complete!"
echo "======================================"
echo " Server: build/rtype-server"
echo " Client: build/rtype-client"
else
echo "Build failed!"
exit 1
fi