-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·38 lines (30 loc) · 908 Bytes
/
build.sh
File metadata and controls
executable file
·38 lines (30 loc) · 908 Bytes
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
#!/bin/bash
# Define the build directory and the build type (Release or Debug)
BUILD_DIR="build"
BUILD_TYPE="Debug" # Change to "Release" for Release build
# Check if the user passed a build type argument
if [ ! -z "$1" ]; then
BUILD_TYPE=$1
fi
# Create the build directory if it doesn't exist
mkdir -p ${BUILD_DIR}
# Navigate to the build directory
cd ${BUILD_DIR}
# Run cmake to configure the project and specify Ninja as the generator
echo "Configuring the project with CMake (Build Type: ${BUILD_TYPE})..."
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -G Ninja ..
# Check if CMake configuration was successful
if [ $? -ne 0 ]; then
echo "CMake configuration failed!"
exit 1
fi
# Build the project using Ninja
echo "Building the project using Ninja..."
ninja
# Check if the build was successful
if [ $? -eq 0 ]; then
echo "Build completed successfully!"
else
echo "Build failed!"
exit 1
fi