-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfull_build.py
37 lines (29 loc) · 937 Bytes
/
full_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
'''
Usage : python full_build.py <optional: max_arity = 50>
The script must be called from the build folder, created in the project's root directory.
This script execute in this order :
- cmake -DMAKE_GENERATORS=1 ..
- cmake --build .
- ./make_arity_functions max_arity
- ./make_single_header
- cmake -DMAKE_GENERATORS=0 ..
- cmake --build .
- ctest -V
'''
import os
import sys
from subprocess import call
argc = len(sys.argv)
if argc > 2:
print('Usage : python full_build.py <optional: max_arity = 50>')
sys.exit(1)
max_arity = sys.argv[1] if argc == 2 else 50
def check(code):
if code != 0: sys.exit(1)
check(call(['cmake', '-DMAKE_GENERATORS=1', '..']))
check(call(['cmake', '--build', '.']))
check(call(['./make_arity_functions', str(max_arity)]))
check(call(['./make_single_header']))
check(call(['cmake', '-DMAKE_GENERATORS=0', '..']))
check(call(['cmake', '--build', '.']))
check(call(['ctest', '-V']))