-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·51 lines (41 loc) · 1.12 KB
/
dev.sh
File metadata and controls
executable file
·51 lines (41 loc) · 1.12 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
45
46
47
48
49
50
51
#!/bin/bash
set -eu
mkdir -p build
HI='\033[0;32m'
NC='\033[0m'
function build {
cc=$1
cxx=$2
build_type=$3
echo -e "${HI}Building $cc $build_type${NC}"
cmake -S . \
-B build/build-${cc}-${build_type} \
-G Ninja \
-DCMAKE_BUILD_TYPE=$build_type \
-DCMAKE_C_COMPILER=$cc \
-DCMAKE_CXX_COMPILER=$cxx
cmake --build build/build-${cc}-${build_type} --parallel $(nproc)
}
if [ $# -ne 0 ] && [ "$1" == "check-compile" ]; then
build gcc g++ Release
build gcc g++ Debug
build clang clang++ Release
build clang clang++ Debug
exit 0
fi
cmake -S . \
-B build \
-G Ninja \
-DBORT_BUILD_TESTS=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -Wall -Wextra -pedantic" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1
cmake --build build --parallel $(nproc)
cp -f build/compile_commands.json .
if [ $# -ne 0 ] && [ "$1" == "run" ]; then
echo -e "----------------------------------\n"
set -eux
./build/bort --dump-ast --emit-ir --dump-codegen-info -o - ./tests/corpus/arrays.c
fi