-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
35 lines (27 loc) · 792 Bytes
/
build.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
#!/bin/bash
set -e
BUILD_DIR=build
BUILD_TYPE=Debug
CLANG=$(command -v clang) || true
CLANGXX=$(command -v clang++) || true
CMAKE_C_COMPILER=cc
CMAKE_CXX_COMPILER=c++
# Check for clang and clang++
# if [ "$CLANG" ] || [ "$CLANGXX" ]; then
# echo "clang or clang++ found, using clang/clang++."
# CMAKE_C_COMPILER=clang
# CMAKE_CXX_COMPILER=clang++
# fi
if [ -d "$BUILD_DIR" ]; then
echo "Removing existing build directory..."
rm -rf "$BUILD_DIR"
fi
echo "Creating build directory..."
mkdir "$BUILD_DIR"
cd "$BUILD_DIR"
echo "Generating project with CMake..."
cmake .. -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DTESTS=OFF -DUSE_Z3=OFF \
-DCMAKE_C_COMPILER="$CMAKE_C_COMPILER" -DCMAKE_CXX_COMPILER="$CMAKE_CXX_COMPILER"
echo "Building project..."
make -j32
echo "Build completed."