| 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 glob | 10 import glob |
| 11 import gyp_helper | 11 import gyp_helper |
| 12 import os | 12 import os |
| 13 import re |
| 13 import shlex | 14 import shlex |
| 14 import subprocess | 15 import subprocess |
| 15 import string | 16 import string |
| 16 import sys | 17 import sys |
| 17 import vs_toolchain | 18 import vs_toolchain |
| 18 | 19 |
| 19 script_dir = os.path.dirname(os.path.realpath(__file__)) | 20 script_dir = os.path.dirname(os.path.realpath(__file__)) |
| 20 chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) | 21 chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) |
| 21 | 22 |
| 22 sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) | 23 sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 # violation of the rule causes Xcode to misbehave badly. | 242 # violation of the rule causes Xcode to misbehave badly. |
| 242 # TODO(mark): Find and kill remaining circular dependencies, and remove this | 243 # TODO(mark): Find and kill remaining circular dependencies, and remove this |
| 243 # option. http://crbug.com/35878. | 244 # option. http://crbug.com/35878. |
| 244 # TODO(tc): Fix circular dependencies in ChromiumOS then add linux2 to the | 245 # TODO(tc): Fix circular dependencies in ChromiumOS then add linux2 to the |
| 245 # list. | 246 # list. |
| 246 if sys.platform not in ('darwin',): | 247 if sys.platform not in ('darwin',): |
| 247 args.append('--no-circular-check') | 248 args.append('--no-circular-check') |
| 248 | 249 |
| 249 # We explicitly don't support the make gyp generator (crbug.com/348686). Be | 250 # We explicitly don't support the make gyp generator (crbug.com/348686). Be |
| 250 # nice and fail here, rather than choking in gyp. | 251 # nice and fail here, rather than choking in gyp. |
| 251 if 'make' in os.environ.get('GYP_GENERATORS', ''): | 252 if re.search(r'(^|,|\s)make($|,|\s)', os.environ.get('GYP_GENERATORS', '')): |
| 252 print 'Error: make gyp generator not supported (check GYP_GENERATORS).' | 253 print 'Error: make gyp generator not supported (check GYP_GENERATORS).' |
| 253 sys.exit(1) | 254 sys.exit(1) |
| 254 | 255 |
| 255 # Default to ninja on linux and windows, but only if no generator has | 256 # Default to ninja on linux and windows, but only if no generator has |
| 256 # explicitly been set. | 257 # explicitly been set. |
| 257 # Also default to ninja on mac, but only when not building chrome/ios. | 258 # Also default to ninja on mac, but only when not building chrome/ios. |
| 258 # . -f / --format has precedence over the env var, no need to check for it | 259 # . -f / --format has precedence over the env var, no need to check for it |
| 259 # . set the env var only if it hasn't been set yet | 260 # . set the env var only if it hasn't been set yet |
| 260 # . chromium.gyp_env has been applied to os.environ at this point already | 261 # . chromium.gyp_env has been applied to os.environ at this point already |
| 261 if sys.platform.startswith(('linux', 'win', 'freebsd')) and \ | 262 if sys.platform.startswith(('linux', 'win', 'freebsd')) and \ |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 subprocess.check_call( | 305 subprocess.check_call( |
| 305 [sys.executable, os.path.join(script_dir, 'landmines.py')]) | 306 [sys.executable, os.path.join(script_dir, 'landmines.py')]) |
| 306 | 307 |
| 307 if vs2013_runtime_dll_dirs: | 308 if vs2013_runtime_dll_dirs: |
| 308 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs | 309 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs |
| 309 vs_toolchain.CopyVsRuntimeDlls( | 310 vs_toolchain.CopyVsRuntimeDlls( |
| 310 os.path.join(chrome_src, GetOutputDirectory()), | 311 os.path.join(chrome_src, GetOutputDirectory()), |
| 311 (x86_runtime, x64_runtime)) | 312 (x86_runtime, x64_runtime)) |
| 312 | 313 |
| 313 sys.exit(gyp_rc) | 314 sys.exit(gyp_rc) |
| OLD | NEW |