Skip to content

Commit 9af81fe

Browse files
committed
created new build script
1 parent cb3a53c commit 9af81fe

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

build.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import os
2+
import sys
3+
import argparse
4+
from subprocess import Popen
5+
from subprocess import STDOUT
6+
7+
platforms = ['linux_x64', 'linux_x86', 'osx', 'win32', 'win64', 'uwp']
8+
9+
def is_valid_platform(arg : str):
10+
11+
if not len(arg):
12+
return False
13+
14+
for p in platforms:
15+
if p == arg:
16+
return True
17+
18+
return False
19+
20+
def run_process(args):
21+
print('Running process:' + str(args))
22+
proc = Popen(args, stderr=STDOUT)
23+
proc.wait()
24+
25+
if __name__ == "__main__":
26+
27+
parser = argparse.ArgumentParser(prog='GA Build',
28+
description='Build GA for the desired platform',
29+
usage=f'build.py --platform={platforms}')
30+
31+
parser.add_argument('-p', '--platform')
32+
args = parser.parse_args()
33+
34+
platform = args.platform.strip()
35+
36+
print(platform)
37+
38+
if not is_valid_platform(platform):
39+
print('Invalid argument', parser.usage)
40+
exit(1)
41+
42+
os.makedirs('build', exist_ok=True)
43+
os.chdir('build')
44+
45+
run_process(['cmake', '..', f'-DPLATFORM:STRING={platform}'])
46+

0 commit comments

Comments
 (0)