-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
50 lines (43 loc) · 924 Bytes
/
run.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
error() { echo -e "\033[1;31mError:\033[0m $@" 1>&2; }
dialect='-std=c++20 -fno-rtti -fstrict-enums'
optimizations='-O3 -fipa-pta -flto -fdevirtualize-at-ltrans'
errors='
-Wfatal-errors
-Werror
-Wpedantic
-pedantic-errors
-Wall
-Wextra
-Wno-parentheses
-Wstrict-null-sentinel
-Wdouble-promotion
-Wfloat-equal
-Wcast-qual
-Wzero-as-null-pointer-constant
-Wlogical-op
-Wimplicit-fallthrough=5
-Wnull-dereference
-Wduplicated-branches
-Wctor-dtor-privacy
-Wnon-virtual-dtor
-Wsuggest-final-types
-Wsuggest-final-methods
-Wsuggest-override
-Wformat-overflow
-Wformat-security
-Wformat-signedness
-Wuseless-cast
-Wextra-semi
-Wredundant-decls'
params="$dialect $optimizations $errors"
if [[ $# -ne 1 ]]; then
error "Wrong number of arguments!"
exit 1
fi
target="$1"
if [[ "$target" -lt 10 ]]; then
target="0$target"
fi
cd $target-*
g++ main.cpp -o main $dialect $optimizations $errors
./main