-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.py
61 lines (49 loc) · 946 Bytes
/
build.py
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
# Must use Python 3
import os
CompilerName = 'g++'
CppStandard = '-std=c++11'
ExecutableName = 'breeze'
# Debug mode
DebugMode = False
# Add here all the files you want to be compiled.
files = [
'Main.cpp',
'Tokenizer.cpp',
'Arguments.cpp',
'Gen.cpp',
]
# Include and external libs paths
paths = [
'',
]
# Compilation falgs
rflags = [
'-Wall',
'-Wextra',
'-O2',
'-s',
'-lpthread',
]
dflags = [
'-Wall',
'-Wextra',
'-g',
'-lpthread',
]
# The string is going to be executed
OutString = f'{CompilerName} {CppStandard} -o {ExecutableName}'
# add debugs
if DebugMode:
for f in dflags:
OutString += ' ' + f
else:
for f in rflags:
OutString += ' ' + f
# Add the files into the 'OutString'
for fp in files:
OutString += ' ' + fp
for p in paths:
OutString += ' ' + p
# Execute the OutString
print(OutString)
os.system(f"{OutString} && {ExecutableName}")