addon: write gyp generated files to the 'out' dir
This commit is contained in:
parent
d03b8487c6
commit
3f1f2d1497
@ -3,7 +3,11 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
script_dir = os.path.dirname(__file__)
|
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'))
|
sys.path.insert(0, os.path.join(node_root, 'tools', 'gyp', 'pylib'))
|
||||||
import gyp
|
import gyp
|
||||||
@ -22,6 +26,12 @@ if __name__ == '__main__':
|
|||||||
args.extend(['-Dnode_root_dir=%s' % node_root])
|
args.extend(['-Dnode_root_dir=%s' % node_root])
|
||||||
args.extend(['--depth=.']);
|
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)
|
gyp_args = list(args)
|
||||||
rc = gyp.main(gyp_args)
|
rc = gyp.main(gyp_args)
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user