-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathconfigure.py
executable file
·58 lines (38 loc) · 1.4 KB
/
configure.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
#!/usr/bin/env python3
#
# configure.py
# Copyright (c) 2020 Raphael DINGE
#
#Tab=3########################################################################
##### IMPORT #################################################################
from __future__ import print_function
import os
import sys
import subprocess
PATH_THIS = os.path.abspath (os.path.dirname (__file__))
PATH_ROOT = os.path.abspath (os.path.dirname (PATH_THIS))
sys.path.insert (0, os.path.join (PATH_ROOT, 'submodules', 'gyp-next', 'pylib'))
import gyp
##############################################################################
if sys.version_info < (3, 7):
print ('This script requires python 3.7 or greater.', file = sys.stderr)
sys.exit (1)
"""
==============================================================================
Name : configure
==============================================================================
"""
def configure ():
os.chdir (PATH_THIS)
gyp_args = [
'--depth=.',
'--generator-output=%s' % os.path.join (PATH_THIS, 'artifacts'),
]
gyp.main (gyp_args + ['build-system.gyp'])
##############################################################################
if __name__ == '__main__':
try:
sys.exit (configure ())
except subprocess.CalledProcessError as error:
print ('Configure command exited with %d' % error.returncode, file = sys.stderr)
sys.exit (1)