-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·43 lines (37 loc) · 1.15 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
#!/usr/bin/env bash
mkdir -p build
cd build
if [ "$CXX" = "" ]; then
if which clang++ > /dev/null; then
export CXX=clang++
elif which clang++-19 > /dev/null; then
export CXX=clang++-19
elif which clang++-18 > /dev/null; then
export CXX=clang++-18
elif which clang++-17 > /dev/null; then
export CXX=clang++-17
elif which clang++-16 > /dev/null; then
export CXX=clang++-16
elif which clang++-15 > /dev/null; then
export CXX=clang++-15
elif which clang++-14 > /dev/null; then
export CXX=clang++-14
elif which clang++-13 > /dev/null; then
export CXX=clang++-13
elif which clang++-12 > /dev/null; then
export CXX=clang++-12
elif which clang++-11 > /dev/null; then
export CXX=clang++-11
else
echo "Clang not detected"
fi
fi
echo "CXX=$CXX"
# Uncomment to use LLVM standard library
#if echo $CXX | grep clang++ > /dev/null; then
# export CXXFLAGS="-stdlib=libc++"
#fi
cmake ..
make
# Simpler way to build without cmake, but with dynamic linking
#mkdir -p build && $CXX main.cpp -o build/stress_memcg -O3 -pthread -fno-omit-frame-pointer