diff options
author | Nathan Rajlich <nathan@tootallnate.net> | 2012-03-05 12:38:31 -0800 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-03-05 22:39:12 +0100 |
commit | 1520c7bf5b4586c00ceef95ef9c52adb3ee86217 (patch) | |
tree | 892fde1e4210396e771ea7b23aa58d7b5c68927d /tools | |
parent | e10bd5177f99ae029d08077ff77c50444697e25c (diff) | |
download | node-new-1520c7bf5b4586c00ceef95ef9c52adb3ee86217.tar.gz |
addon: add module_root_dir gyp variable
For native modules to use in their gyp files.
It gives the absolute path to the root of the module directory, i.e. where your
main binding.gyp file is located.
This seems helpful for some modules where the build system is more advanced and
using absolute paths is a requirement.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/gyp_addon | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/gyp_addon b/tools/gyp_addon index f672f9ea66..b6f2d643b2 100755 --- a/tools/gyp_addon +++ b/tools/gyp_addon @@ -4,8 +4,9 @@ import sys script_dir = os.path.dirname(__file__) node_root = os.path.abspath(os.path.join(script_dir, os.pardir)) +module_root = os.getcwd() if sys.platform == 'win32': - output_dir = os.path.join(os.getcwd(), 'build') + output_dir = os.path.join(module_root, 'build') else: output_dir = 'build' @@ -24,6 +25,7 @@ if __name__ == '__main__': args.extend(['-Dlibrary=shared_library']) args.extend(['-Dvisibility=default']) args.extend(['-Dnode_root_dir=%s' % node_root]) + args.extend(['-Dmodule_root_dir=%s' % module_root]) args.extend(['--depth=.']); # Tell gyp to write the Makefile/Solution files into output_dir |