diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-12-21 10:03:32 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-12-21 10:03:35 +0400 |
commit | 18b92201be7e654ac9997b947d38aaf46adee06d (patch) | |
tree | 85bbbbb6e17f6b91615533a05987ae238703b973 /tools | |
parent | 7edfb029844cf10cc1d815dadc7384fdb285f4e9 (diff) |
Support addons with gyp
Initial pass.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/addon.gypi | 17 | ||||
-rwxr-xr-x | tools/gyp_addon | 26 |
2 files changed, 43 insertions, 0 deletions
diff --git a/tools/addon.gypi b/tools/addon.gypi new file mode 100644 index 00000000000..ad2237e6d32 --- /dev/null +++ b/tools/addon.gypi @@ -0,0 +1,17 @@ +{ + 'target_defaults': { + 'type': 'loadable_module', + 'product_extension': 'node', + 'include_dirs': [ + '../src', + '../deps/uv/include', + '../deps/v8/include' + ], + + 'conditions': [ + [ 'OS=="mac"', { + 'libraries': [ '-undefined dynamic_lookup' ], + }] + ] + } +} diff --git a/tools/gyp_addon b/tools/gyp_addon new file mode 100755 index 00000000000..a93f7b27d91 --- /dev/null +++ b/tools/gyp_addon @@ -0,0 +1,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(['--depth=.']); + + gyp_args = list(args) + rc = gyp.main(gyp_args) + if rc != 0: + print 'Error running GYP' + sys.exit(rc) + |