| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/python | |
| 2 import os | |
| 3 import sys | |
| 4 | |
| 5 script_dir = os.path.dirname(__file__) | |
| 6 | |
| 7 skia_src = os.path.abspath(os.environ.get('SKIA_SRC', os.path.join( script_dir,
"..", ".."))) | |
| 8 gyp_source_dir = os.path.join(skia_src, 'third_party', 'externals', 'gyp') | |
| 9 | |
| 10 WEBTRY_CACHE_DEFAULT = os.path.join(script_dir, "..", "..", "..", "cache") | |
| 11 WEBTRY_INOUT_DEFAULT = os.path.join(script_dir, "..", "..", "..", "inout") | |
| 12 | |
| 13 sys.path.insert(0, os.path.abspath(os.path.join(gyp_source_dir, 'pylib'))) | |
| 14 import gyp | |
| 15 | |
| 16 if __name__ == '__main__': | |
| 17 if len(sys.argv) < 2: | |
| 18 print "Usage: gyp_for_webtry [code hash value]" | |
| 19 sys.exit(-1) | |
| 20 | |
| 21 args = sys.argv[2:] | |
| 22 | |
| 23 if not os.environ.get('GYP_GENERATORS'): | |
| 24 os.environ['GYP_GENERATORS'] = 'ninja' | |
| 25 | |
| 26 args.append('--check') | |
| 27 args.append('-I%s/gyp/common.gypi' % skia_src) | |
| 28 args.extend(['--depth', '.']) | |
| 29 webtry_cache_dir = os.path.abspath(os.environ.get('WEBTRY_CACHE', WEBTRY_CACHE
_DEFAULT)) | |
| 30 webtry_inout_dir = os.path.abspath(os.environ.get('WEBTRY_INOUT', WEBTRY_INOUT
_DEFAULT)) | |
| 31 | |
| 32 args.append('-Goutput_dir=%s' % webtry_inout_dir) | |
| 33 | |
| 34 args.append(os.path.join(webtry_cache_dir, '%s.gyp' % sys.argv[1])) | |
| 35 | |
| 36 # gyp is really picky about the current working directory having src/ under it | |
| 37 os.chdir(webtry_cache_dir) | |
| 38 | |
| 39 os.environ['CC'] = '../../skia/experimental/webtry/safec' | |
| 40 os.environ['CXX'] = '../../skia/experimental/webtry/safec++' | |
| 41 os.environ['LD'] = '../../skia/experimental/webtry/safec++' | |
| 42 | |
| 43 sys.exit(gyp.main(args)) | |
| OLD | NEW |