| 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 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 Reads in a *.gyp_env file and applies the valid keys to os.environ. | 49 Reads in a *.gyp_env file and applies the valid keys to os.environ. |
| 50 """ | 50 """ |
| 51 if not file_path or not os.path.exists(file_path): | 51 if not file_path or not os.path.exists(file_path): |
| 52 return | 52 return |
| 53 file_contents = open(file_path).read() | 53 file_contents = open(file_path).read() |
| 54 try: | 54 try: |
| 55 file_data = eval(file_contents, {'__builtins__': None}, None) | 55 file_data = eval(file_contents, {'__builtins__': None}, None) |
| 56 except SyntaxError, e: | 56 except SyntaxError, e: |
| 57 e.filename = os.path.abspath(file_path) | 57 e.filename = os.path.abspath(file_path) |
| 58 raise | 58 raise |
| 59 supported_vars = ( 'CHROMIUM_GYP_FILE', | 59 supported_vars = ( 'CC', |
| 60 'CHROMIUM_GYP_FILE', |
| 60 'CHROMIUM_GYP_SYNTAX_CHECK', | 61 'CHROMIUM_GYP_SYNTAX_CHECK', |
| 62 'CXX', |
| 61 'GYP_DEFINES', | 63 'GYP_DEFINES', |
| 62 'GYP_GENERATOR_FLAGS', | 64 'GYP_GENERATOR_FLAGS', |
| 63 'GYP_GENERATOR_OUTPUT', | 65 'GYP_GENERATOR_OUTPUT', |
| 64 'GYP_GENERATORS', ) | 66 'GYP_GENERATORS', ) |
| 65 for var in supported_vars: | 67 for var in supported_vars: |
| 66 val = file_data.get(var) | 68 val = file_data.get(var) |
| 67 if val: | 69 if val: |
| 68 if var in os.environ: | 70 if var in os.environ: |
| 69 print 'INFO: Environment value for "%s" overrides value in %s.' % ( | 71 print 'INFO: Environment value for "%s" overrides value in %s.' % ( |
| 70 var, os.path.abspath(file_path) | 72 var, os.path.abspath(file_path) |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 # to enfore syntax checking. | 166 # to enfore syntax checking. |
| 165 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 167 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
| 166 if syntax_check and int(syntax_check): | 168 if syntax_check and int(syntax_check): |
| 167 args.append('--check') | 169 args.append('--check') |
| 168 | 170 |
| 169 print 'Updating projects from gyp files...' | 171 print 'Updating projects from gyp files...' |
| 170 sys.stdout.flush() | 172 sys.stdout.flush() |
| 171 | 173 |
| 172 # Off we go... | 174 # Off we go... |
| 173 sys.exit(gyp.main(args)) | 175 sys.exit(gyp.main(args)) |
| OLD | NEW |