-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.sh
executable file
·54 lines (43 loc) · 1.06 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -eou pipefail
# test that specific compiler versions exists
if ! /usr/bin/clang++-20 --version &>/dev/null; then
echo -e "\e[31m ❌ Clang++20 not found!\e[0m"
exit 1
fi
if ! /usr/bin/g++-14 --version &>/dev/null; then
echo -e "\e[31m ❌ G++14 not found!\e[0m"
exit 1
fi
echo -e "\e[33m== Building devbox-test ==\e[0m"
# create and switch to build dir (Build Tree)
mkdir -p build-gcc build-clang
echo -e "\e[33m== Build with GCC 14 ==\e[0m"
cd build-gcc
# configure
cmake -S .. -DCMAKE_CXX_COMPILER=/usr/bin/g++-14
# verify configuration
#cmake -LAH ..
# build
cmake --build .
# test
# test
if ctest; then
echo -e "\e[32m ✅ [GCC] Build and tests completed successfully!\e[0m"
else
echo -e "\e[31m ❌ Tests failed!\e[0m"
exit 1
fi
cd ..
echo -e "\e[33m== Build with Clang 20 ==\e[0m"
cd build-clang
cmake -S .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++-20
cmake --build .
# test
if ctest; then
echo -e "\e[32m ✅ [CLANG] Build and tests completed successfully!\e[0m"
else
echo -e "\e[31m ❌ Tests failed!\e[0m"
exit 1
fi
cd ..