-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.py
69 lines (54 loc) · 1.73 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import subprocess
# NOTE: You will need to compile the editor with 'dlink_enabled=yes' to have GDExtension support in web builds
if __name__ == '__main__':
platform = 'linux'
arch = 'x86_64'
target = 'debug'
extra_args = ''
use_system = False
print('GoZen GDExtension builder')
print('Select platform:')
print('1. Linux; (default)')
print('2. Windows;')
match input('> '):
case '2':
platform = 'windows'
print('Select target:')
print('1. Debug; (default)')
print('2. Release.')
match input('> '):
case '2':
target = 'release'
case _:
extra_args += ' dev_build=yes'
if platform == 'linux':
print('Use system FFmpeg:')
print('1. No; (default)')
print('2. Yes.')
match input('> '):
case '2':
extra_args += ' use_system=yes'
use_system = True
case _:
extra_args += ' use_system=no'
if not use_system:
print('Recompile FFmpeg:')
print('1. Yes; (default)')
print('2. No.')
match input('> '):
case '2':
extra_args += ' recompile_ffmpeg=no'
user_input = input('Number of threads/cores for compiling> ')
if user_input.isdigit():
jobs = int(user_input)
else:
jobs = 1
print('Select location:')
print('1. Bin; (default)')
print('2. Test room.')
match input('> '):
case '2':
extra_args += ' location=test_room/addons/gde_gozen/bin'
case _:
extra_args += ' location=bin'
subprocess.run(f'scons -j{jobs} target=template_{target} platform={platform} arch={arch} {extra_args}', shell=True, cwd='./')