-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile.rc
More file actions
70 lines (63 loc) · 2 KB
/
compile.rc
File metadata and controls
70 lines (63 loc) · 2 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
if os == 'windows'
depends('cl.exe') # *.exe is important
else
depends('g++')
depends('mv')
depends('mkdir')
endif
# check if all source files are present
depends('./runcpp/src/colorize/colorize.hh')
depends('./runcpp/src/colorize/colorize.cc')
depends('./runcpp/src/caller/caller.hh')
depends('./runcpp/src/caller/caller.cc')
depends('./runcpp/src/command_line/command_line.hh')
depends('./runcpp/src/command_line/command_line.cc')
depends('./runcpp/src/help/help.h')
depends('./runcpp/src/io/io.hh')
depends('./runcpp/src/io/io.cc')
depends('./runcpp/src/main/main.cc')
depends('./runcpp/src/os/os.hh')
depends('./runcpp/src/os/os.cc')
depends('./runcpp/src/parser/parser.hh')
depends('./runcpp/src/parser/command_generator.cc')
depends('./runcpp/src/parser/helper_functions.cc')
depends('./runcpp/src/parser/import_helper.cc')
depends('./runcpp/src/parser/miscellaneous.cc')
depends('./runcpp/src/parser/parser.cc')
depends('./runcpp/src/parser/serialize_deserialize_merge.cc')
depends('./runcpp/src/parser/used_keywords.h')
[compiler]:
if os == 'windows'
compiler = 'cl.exe'
else
compiler = 'g++'
endif
[arguments]:
if os == 'windows'
release_args = ['/std:c++latest', '/O2', '/DNDEBUG', '/EHsc']
else
release_args = ['-std=c++20', '-O3', '-DNDEBUG', '-march=native', '-mtune=native', '-masm=intel', '-flto']
debug_args = ['-std=c++20', '-g', '-ggdb3', '-Wall', '-Wextra', '-Wuninitialized', '-Wstrict-aliasing', '-Wshadow', '-pedantic']
endif
if os != 'windows'
[strip]:
cmd = ['strip', './bin/runcpp'] # reduces size
endif
[setup]:
if os != 'windows'
make_dir = ['mkdir', '-p', './bin'] # this command will 100% work
else
depends('./bin')
endif
import "./runcpp/compile.rc"
# here we are using `all`, which means every command is executed like a separate process
[all]:
if os != 'windows'
setup()
endif
release()
if os != 'windows'
debug()
strip()
install()
endif