Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
addon: write gyp generated files to the 'out' dir
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate authored and bnoordhuis committed Feb 27, 2012
1 parent d03b848 commit 3f1f2d1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tools/gyp_addon
Expand Up @@ -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'

This comment has been minimized.

Copy link
@TooTallNate

TooTallNate Feb 27, 2012

Author

Additionally, if we just change these two 'out' instances to 'build', then the gyp_addon would build its files in the same place node-waf does. I'm not sure if anyone has a strong preference there. I personally don't. But I know that npm looks for a build dir specifically, so maybe @isaacs has some opinion on that.


sys.path.insert(0, os.path.join(node_root, 'tools', 'gyp', 'pylib'))
import gyp
Expand All @@ -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:
Expand Down

0 comments on commit 3f1f2d1

Please sign in to comment.