-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgbuild
executable file
·37 lines (27 loc) · 843 Bytes
/
gbuild
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
#!/usr/bin/python3
import subprocess
import os
import shutil
import sys
clean_project = False
if len(sys.argv) == 2 and sys.argv[1] == "--clean":
clean_project = True
if clean_project:
print("Cleaning project before building")
subprocess.run(["conan", "remove", "grumble", "-c"])
if os.path.isdir("build"):
shutil.rmtree("build")
if os.path.isdir("CMakeFiles"):
shutil.rmtree("CMakeFiles")
subprocess.run(["conan", "install", "." ,"--output-folder=build", "--build=missing"])
os.chdir("build")
subprocess.run([
"cmake",
"..",
"-DCMAKE_TOOLCHAIN_FILE='conan_toolchain.cmake'",
"-DCMAKE_BUILD_TYPE=Debug",
"-DCMAKE_EXPORT_COMPILE_COMMANDS=1"
])
subprocess.run(["cmake", "--build", ".", "--config Debug"])
os.chdir("..")
subprocess.run(["conan", "export-pkg", ".", "--output-folder" , "conan"])