-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrun.py
executable file
·41 lines (33 loc) · 1.1 KB
/
run.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
#!/usr/bin/python3
import os
import argparse
import subprocess
def main():
parser = argparse.ArgumentParser(description='build and run program')
parser.add_argument('-d', action='store_true',
help='Flag for debug mode compilation')
args = parser.parse_args()
os.system('rm ./bin/solution')
os.system('rm -rf ./CMakeFiles')
os.system('rm ./cmake_install.cmake')
os.system('rm ./Makefile')
print("/--------------------------------/")
print(" Configuring CMake...")
print("/--------------------------------/")
if args.d:
os.system('cmake . -DCMAKE_BUILD_TYPE=Debug')
else:
os.system('cmake . -DCMAKE_BUILD_TYPE=Release')
print("")
print("/--------------------------------/")
print(" Building target...")
print("/--------------------------------/")
os.system('make')
print("")
print("/--------------------------------/")
print(" Run solution program")
print("/--------------------------------/")
print("")
os.system('./bin/solution')
if __name__ == '__main__':
main()