forked from nodejs/node-v0.x-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgyp_addon
More file actions
executable file
·27 lines (22 loc) · 744 Bytes
/
gyp_addon
File metadata and controls
executable file
·27 lines (22 loc) · 744 Bytes
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
#!/usr/bin/env python
import os
import sys
script_dir = os.path.dirname(__file__)
node_root = os.path.normpath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.join(node_root, 'tools', 'gyp', 'pylib'))
import gyp
if __name__ == '__main__':
args = sys.argv[1:]
addon_gypi = os.path.join(node_root, 'tools', 'addon.gypi')
common_gypi = os.path.join(node_root, 'common.gypi')
args.extend(['-I', addon_gypi])
args.extend(['-I', common_gypi])
args.extend(['-Dlibrary=shared_library'])
args.extend(['-Dvisibility=default'])
args.extend(['-Dnode_root_dir=%s' % node_root])
args.extend(['--depth=.']);
gyp_args = list(args)
rc = gyp.main(gyp_args)
if rc != 0:
print 'Error running GYP'
sys.exit(rc)