| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # This file helps gyp_chromium and landmines correctly set up the gyp | 5 # This file helps gyp_chromium and landmines correctly set up the gyp |
| 6 # environment from chromium.gyp_env on disk | 6 # environment from chromium.gyp_env on disk |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 | 9 |
| 10 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) | 10 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 'GYP_INCLUDE_FIRST', | 37 'GYP_INCLUDE_FIRST', |
| 38 'GYP_INCLUDE_LAST', | 38 'GYP_INCLUDE_LAST', |
| 39 'GYP_MSVS_VERSION', | 39 'GYP_MSVS_VERSION', |
| 40 ) | 40 ) |
| 41 for var in supported_vars: | 41 for var in supported_vars: |
| 42 file_val = file_data.get(var) | 42 file_val = file_data.get(var) |
| 43 if file_val: | 43 if file_val: |
| 44 if var in os.environ: | 44 if var in os.environ: |
| 45 behavior = 'replaces' | 45 behavior = 'replaces' |
| 46 if var == 'GYP_DEFINES': | 46 if var == 'GYP_DEFINES': |
| 47 os.environ[var] = file_val + ' ' + os.environ[var] | 47 result = file_val + ' ' + os.environ[var] |
| 48 behavior = 'overrides' | 48 behavior = 'merges with, and individual components override,' |
| 49 else: |
| 50 result = os.environ[var] |
| 49 print 'INFO: Environment value for "%s" %s value in %s' % ( | 51 print 'INFO: Environment value for "%s" %s value in %s' % ( |
| 50 var, behavior, os.path.abspath(file_path) | 52 var, behavior, os.path.abspath(file_path) |
| 51 ) | 53 ) |
| 54 string_padding = max(len(var), len(file_path), len('result')) |
| 55 print ' %s: %s' % (var.rjust(string_padding), os.environ[var]) |
| 56 print ' %s: %s' % (file_path.rjust(string_padding), file_val) |
| 57 os.environ[var] = result |
| 52 else: | 58 else: |
| 53 os.environ[var] = file_val | 59 os.environ[var] = file_val |
| 54 | 60 |
| 55 | 61 |
| 56 def apply_chromium_gyp_env(): | 62 def apply_chromium_gyp_env(): |
| 57 if 'SKIP_CHROMIUM_GYP_ENV' not in os.environ: | 63 if 'SKIP_CHROMIUM_GYP_ENV' not in os.environ: |
| 58 # Update the environment based on chromium.gyp_env | 64 # Update the environment based on chromium.gyp_env |
| 59 path = os.path.join(os.path.dirname(CHROME_SRC), 'chromium.gyp_env') | 65 path = os.path.join(os.path.dirname(CHROME_SRC), 'chromium.gyp_env') |
| 60 apply_gyp_environment_from_file(path) | 66 apply_gyp_environment_from_file(path) |
| OLD | NEW |