0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/tools/gyp_addon

31 lines
870 B
Plaintext
Raw Normal View History

2011-12-21 07:03:32 +01:00
#!/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'))
2011-12-21 07:03:32 +01:00
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')
config_gypi = os.path.join(node_root, 'config.gypi')
2011-12-21 07:03:32 +01:00
args.extend(['-I', addon_gypi])
args.extend(['-I', common_gypi])
if os.path.exists(config_gypi):
args.extend(['-I', config_gypi])
2011-12-21 07:03:32 +01:00
args.extend(['-Dlibrary=shared_library'])
args.extend(['-Dvisibility=default'])
args.extend(['-Dnode_root_dir=%s' % node_root])
2011-12-21 07:03:32 +01:00
args.extend(['--depth=.']);
gyp_args = list(args)
rc = gyp.main(gyp_args)
if rc != 0:
print 'Error running GYP'
sys.exit(rc)