node/deps/uv/gyp_uv

43 lines
1.0 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env python
2011-08-04 08:23:38 +08:00
import glob
import os
import shlex
import sys
script_dir = os.path.dirname(__file__)
2011-08-11 05:23:26 +08:00
uv_root = os.path.abspath(script_dir)
2011-08-04 08:23:38 +08:00
sys.path.insert(0, os.path.join(uv_root, 'build', 'gyp', 'pylib'))
import gyp
2011-08-06 18:38:11 +08:00
# Directory within which we want all generated files (including Makefiles)
# to be written.
output_dir = os.path.join(os.path.abspath(uv_root), 'out')
2011-08-04 08:23:38 +08:00
def run_gyp(args):
rc = gyp.main(args)
if rc != 0:
print 'Error running GYP'
sys.exit(rc)
if __name__ == '__main__':
args = sys.argv[1:]
2011-08-06 18:38:11 +08:00
2011-08-04 08:23:38 +08:00
args.append(os.path.join(script_dir, 'all.gyp'))
args.append('-I' + os.path.join(script_dir, 'common.gypi'))
2011-08-06 18:38:11 +08:00
2011-08-04 08:23:38 +08:00
args.append('--depth=' + uv_root)
2011-08-06 18:38:11 +08:00
# There's a bug with windows which doesn't allow this feature.
if sys.platform != 'win32':
# Tell gyp to write the Makefiles into output_dir
args.extend(['--generator-output', output_dir])
# Tell make to write its output into the same dir
args.extend(['-Goutput_dir=' + output_dir])
2011-08-04 08:23:38 +08:00
gyp_args = list(args)
run_gyp(gyp_args)