-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain
More file actions
executable file
·42 lines (37 loc) · 786 Bytes
/
main
File metadata and controls
executable file
·42 lines (37 loc) · 786 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
flags=(
"-ferror-limit=1"
"-ffast-math"
"-fno-autolink"
"-fno-exceptions"
"-fno-math-errno"
"-fno-rtti"
"-fno-unwind-tables"
"-fshort-enums"
"-g"
"-march=native"
"-nostdlib++"
"-O3"
"-pthread"
"-std=gnu++11"
"-Werror"
"-Weverything"
"-Wno-c++98-compat"
"-Wno-c++98-compat-pedantic"
"-Wno-c99-extensions"
"-Wno-padded"
"-Wno-reserved-id-macro"
"-Wno-unsafe-buffer-usage"
)
now () {
date +%s.%N
}
(
start=$(now)
clang-format -i -verbose "$WD/src"/*
mold -run clang++ -o "$WD/bin/main" "${flags[@]}" "$WD/src/main.cpp"
end=$(now)
python3 -c "print(\"Compiled! ({:.3f}s)\n\".format($end - $start))"
)
"$WD/bin/main" "$WD/out/main.bmp"