Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # This script is wrapper for Chromium that adds some support for how GYP | 7 # This script is wrapper for Chromium that adds some support for how GYP |
| 8 # is invoked by Chromium beyond what can be done in the gclient hooks. | 8 # is invoked by Chromium beyond what can be done in the gclient hooks. |
| 9 | 9 |
| 10 import argparse | 10 import argparse |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 if int(os.environ.get('GYP_CHROMIUM_NO_ACTION', 0)): | 211 if int(os.environ.get('GYP_CHROMIUM_NO_ACTION', 0)): |
| 212 print 'Skipping gyp_chromium due to GYP_CHROMIUM_NO_ACTION env var.' | 212 print 'Skipping gyp_chromium due to GYP_CHROMIUM_NO_ACTION env var.' |
| 213 sys.exit(0) | 213 sys.exit(0) |
| 214 | 214 |
| 215 # Use the Psyco JIT if available. | 215 # Use the Psyco JIT if available. |
| 216 if psyco: | 216 if psyco: |
| 217 psyco.profile() | 217 psyco.profile() |
| 218 print "Enabled Psyco JIT." | 218 print "Enabled Psyco JIT." |
| 219 | 219 |
| 220 # Fall back on hermetic python if we happen to get run under cygwin. | 220 # Fall back on hermetic python if we happen to get run under cygwin. |
| 221 # TODO(bradnelson): take this out once this issue is fixed: | 221 # TODO(bradnelson): take this out once this issue is fixed: |
|
scottmg
2015/05/20 22:30:56
You might as well delete this TODO too, that's nev
Sam Clegg
2015/05/20 22:38:40
Its not? The bug is still open.. there could stil
scottmg
2015/05/20 22:40:45
Sure, ok. :)
| |
| 222 # http://code.google.com/p/gyp/issues/detail?id=177 | 222 # http://code.google.com/p/gyp/issues/detail?id=177 |
| 223 if sys.platform == 'cygwin': | 223 if sys.platform == 'cygwin': |
| 224 import find_depot_tools | 224 import find_depot_tools |
| 225 depot_tools_path = find_depot_tools.add_depot_tools_to_path() | 225 depot_tools_path = find_depot_tools.add_depot_tools_to_path() |
| 226 python_dir = sorted(glob.glob(os.path.join(depot_tools_path, | 226 python_dir = sorted(glob.glob(os.path.join(depot_tools_path, |
| 227 'python2*_bin')))[-1] | 227 'python2*_bin')))[-1] |
| 228 env = os.environ.copy() | 228 env = os.environ.copy() |
| 229 env['PATH'] = python_dir + os.pathsep + env.get('PATH', '') | 229 env['PATH'] = python_dir + os.pathsep + env.get('PATH', '') |
| 230 p = subprocess.Popen( | 230 cmd = [os.path.join(python_dir, 'python.exe')] + sys.argv |
| 231 [os.path.join(python_dir, 'python.exe')] + sys.argv, | 231 sys.exit(subprocess.call(cmd, env=env)) |
| 232 env=env, shell=False) | |
| 233 p.communicate() | |
| 234 sys.exit(p.returncode) | |
| 235 | 232 |
| 236 # This could give false positives since it doesn't actually do real option | 233 # This could give false positives since it doesn't actually do real option |
| 237 # parsing. Oh well. | 234 # parsing. Oh well. |
| 238 gyp_file_specified = False | 235 gyp_file_specified = any(arg.endswith('.gyp') for arg in args) |
| 239 for arg in args: | |
| 240 if arg.endswith('.gyp'): | |
| 241 gyp_file_specified = True | |
| 242 break | |
| 243 | 236 |
| 244 gyp_environment.SetEnvironment() | 237 gyp_environment.SetEnvironment() |
| 245 | 238 |
| 246 # If we didn't get a file, check an env var, and then fall back to | 239 # If we didn't get a file, check an env var, and then fall back to |
| 247 # assuming 'all.gyp' from the same directory as the script. | 240 # assuming 'all.gyp' from the same directory as the script. |
| 248 if not gyp_file_specified: | 241 if not gyp_file_specified: |
| 249 gyp_file = os.environ.get('CHROMIUM_GYP_FILE') | 242 gyp_file = os.environ.get('CHROMIUM_GYP_FILE') |
| 250 if gyp_file: | 243 if gyp_file: |
| 251 # Note that CHROMIUM_GYP_FILE values can't have backslashes as | 244 # Note that CHROMIUM_GYP_FILE values can't have backslashes as |
| 252 # path separators even on Windows due to the use of shlex.split(). | 245 # path separators even on Windows due to the use of shlex.split(). |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 | 315 |
| 323 if not use_analyzer: | 316 if not use_analyzer: |
| 324 vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() | 317 vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() |
| 325 if vs2013_runtime_dll_dirs: | 318 if vs2013_runtime_dll_dirs: |
| 326 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs | 319 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs |
| 327 vs_toolchain.CopyVsRuntimeDlls( | 320 vs_toolchain.CopyVsRuntimeDlls( |
| 328 os.path.join(chrome_src, GetOutputDirectory()), | 321 os.path.join(chrome_src, GetOutputDirectory()), |
| 329 (x86_runtime, x64_runtime)) | 322 (x86_runtime, x64_runtime)) |
| 330 | 323 |
| 331 sys.exit(gyp_rc) | 324 sys.exit(gyp_rc) |
| OLD | NEW |