OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright 2011 The Android Open Source Project | 3 # Copyright 2011 The Android Open Source Project |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 # This script is a wrapper which invokes gyp with the correct --depth argument, | 8 # This script is a wrapper which invokes gyp with the correct --depth argument, |
9 # and supports the automatic regeneration of build files if all.gyp is | 9 # and supports the automatic regeneration of build files if all.gyp is |
10 # changed (Linux-only). | 10 # changed (Linux-only). |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 default_gyp_generators = 'ninja,xcode' | 86 default_gyp_generators = 'ninja,xcode' |
87 elif sys.platform.startswith('win'): | 87 elif sys.platform.startswith('win'): |
88 default_gyp_generators = 'ninja,msvs-ninja' | 88 default_gyp_generators = 'ninja,msvs-ninja' |
89 elif sys.platform.startswith('cygwin'): | 89 elif sys.platform.startswith('cygwin'): |
90 default_gyp_generators = 'ninja,msvs-ninja' | 90 default_gyp_generators = 'ninja,msvs-ninja' |
91 else: | 91 else: |
92 default_gyp_generators = 'ninja' | 92 default_gyp_generators = 'ninja' |
93 os.environ[ENVVAR_GYP_GENERATORS] = default_gyp_generators | 93 os.environ[ENVVAR_GYP_GENERATORS] = default_gyp_generators |
94 print '%s is "%s"' % (ENVVAR_GYP_GENERATORS, os.getenv(ENVVAR_GYP_GENERATORS)) | 94 print '%s is "%s"' % (ENVVAR_GYP_GENERATORS, os.getenv(ENVVAR_GYP_GENERATORS)) |
95 | 95 |
96 vs2013_runtime_dll_dirs = None | |
96 if os.getenv('CHROME_HEADLESS', '0') == '1': | 97 if os.getenv('CHROME_HEADLESS', '0') == '1': |
97 if sys.platform.startswith('win') or sys.platform.startswith('cygwin'): | 98 if sys.platform.startswith('win') or sys.platform.startswith('cygwin'): |
98 chrome_path = os.getenv('CHROME_PATH') | 99 chrome_path = os.getenv('CHROME_PATH') |
99 os.chdir(chrome_path) | 100 os.chdir(chrome_path) |
100 sys.path.append(os.path.join(chrome_path, 'build')) | 101 sys.path.append(os.path.join(chrome_path, 'build')) |
101 sys.path.append(os.path.join(chrome_path, 'tools')) | 102 sys.path.append(os.path.join(chrome_path, 'tools')) |
102 import vs_toolchain | 103 import vs_toolchain |
103 vs_toolchain.Update() | 104 vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs( ) |
104 vs_toolchain.GetToolchainDir() | |
105 | 105 |
106 # Set CWD to the directory containing this script. | 106 # Set CWD to the directory containing this script. |
107 # This allows us to launch it from other directories, in spite of gyp's | 107 # This allows us to launch it from other directories, in spite of gyp's |
108 # finickyness about the current working directory. | 108 # finickyness about the current working directory. |
109 # See http://b.corp.google.com/issue?id=5019517 ('Linux make build | 109 # See http://b.corp.google.com/issue?id=5019517 ('Linux make build |
110 # (from out dir) no longer runs skia_gyp correctly') | 110 # (from out dir) no longer runs skia_gyp correctly') |
111 os.chdir(os.path.abspath(script_dir)) | 111 os.chdir(os.path.abspath(script_dir)) |
112 | 112 |
113 # This could give false positives since it doesn't actually do real option | 113 # This could give false positives since it doesn't actually do real option |
114 # parsing. Oh well. | 114 # parsing. Oh well. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 os.environ['GYP_LINK_CONCURRENCY'] = '9001' | 150 os.environ['GYP_LINK_CONCURRENCY'] = '9001' |
151 | 151 |
152 print 'Updating projects from gyp files...' | 152 print 'Updating projects from gyp files...' |
153 sys.stdout.flush() | 153 sys.stdout.flush() |
154 | 154 |
155 if '--dry-run' in args: | 155 if '--dry-run' in args: |
156 args.remove('--dry-run') | 156 args.remove('--dry-run') |
157 print gyp_source_dir, ' '.join(args) | 157 print gyp_source_dir, ' '.join(args) |
158 else: | 158 else: |
159 # Off we go... | 159 # Off we go... |
160 sys.exit(gyp.main(args)) | 160 res = gyp.main(args) |
161 if res: | |
162 sys.exit(res) | |
163 | |
164 if vs2013_runtime_dll_dirs: | |
mtklein
2014/06/16 19:11:29
Can this run before gyp? If so, that can become s
borenet
2014/06/16 19:19:08
No. The out/* directories need to be created befor
| |
165 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs | |
166 vs_toolchain.CopyVsRuntimeDlls( | |
167 os.path.join(os.getenv('CHROME_PATH'), get_output_dir()), | |
168 (x86_runtime, x64_runtime)) | |
mtklein
2014/06/16 19:11:29
Add a comment reassuring us the inverted order is
borenet
2014/06/16 19:19:07
Added not-so-reassuring comment.
| |
OLD | NEW |