5 script_dir = os.path.dirname(__file__)
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')
10 WEBTRY_CACHE_DEFAULT = os.path.join(script_dir, "..", "..", "..", "cache")
11 WEBTRY_INOUT_DEFAULT = os.path.join(script_dir, "..", "..", "..", "inout")
13 sys.path.insert(0, os.path.abspath(os.path.join(gyp_source_dir, 'pylib')))
16 if __name__ == '__main__':
18 print "Usage: gyp_for_webtry [code hash value]"
23 if not os.environ.get('GYP_GENERATORS'):
24 os.environ['GYP_GENERATORS'] = 'ninja'
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))
32 args.append('-Goutput_dir=%s' % webtry_inout_dir)
34 args.append(os.path.join(webtry_cache_dir, '%s.gyp' % sys.argv[1]))
36 # gyp is really picky about the current working directory having src/ under it
37 os.chdir(webtry_cache_dir)
39 os.environ['CC'] = '../../skia/experimental/webtry/safec'
40 os.environ['CXX'] = '../../skia/experimental/webtry/safec++'
41 os.environ['LD'] = '../../skia/experimental/webtry/safec++'
43 sys.exit(gyp.main(args))