forked from phbasler/BSMPT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.py
42 lines (32 loc) · 948 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
import Setup
import subprocess
import sys
def get_preset():
preset = "conan-"
os = sys.platform
if os == "win32":
preset += "windows"
elif os == "linux":
preset += "linux"
elif os == "darwin":
preset += "macos"
preset += "-"
preset += Setup.get_arch()
preset += "-release"
return preset
def build(preset):
cmd=f"cmake --preset {preset} --fresh".split()
subprocess.check_call(cmd)
cmd=f"cmake --build --preset {preset}".split()
subprocess.check_call(cmd)
def main():
opts = Setup.parse_arguments()
Setup.setup_profiles()
Setup.conan_install_all(Setup.BuildMode.release,
opts.options if opts.options is not None else [],
build_missing=True,
custom_profile=opts.profile
)
build(get_preset())
if __name__ == "__main__":
main()