From 3f1f2d149724b617418ac2212ac829b12b50d321 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sun, 26 Feb 2012 13:23:42 -0800 Subject: [PATCH] addon: write gyp generated files to the 'out' dir --- tools/gyp_addon | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/gyp_addon b/tools/gyp_addon index efa8f42b37..35c4158152 100755 --- a/tools/gyp_addon +++ b/tools/gyp_addon @@ -3,7 +3,11 @@ import os import sys script_dir = os.path.dirname(__file__) -node_root = os.path.normpath(os.path.join(script_dir, os.pardir)) +node_root = os.path.abspath(os.path.join(script_dir, os.pardir)) +if sys.platform == 'win32': + output_dir = os.path.join(os.getcwd(), 'out') +else: + output_dir = 'out' sys.path.insert(0, os.path.join(node_root, 'tools', 'gyp', 'pylib')) import gyp @@ -22,6 +26,12 @@ if __name__ == '__main__': args.extend(['-Dnode_root_dir=%s' % node_root]) args.extend(['--depth=.']); + # Tell gyp to write the Makefile/Solution files into output_dir + args.extend(['--generator-output', output_dir]) + + # Tell make to write its output into the same dir + args.extend(['-Goutput_dir=.']) + gyp_args = list(args) rc = gyp.main(gyp_args) if rc != 0: