| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """ | 5 """ |
| 6 Sets up various automatic gyp environment variables. These are used by | 6 Sets up various automatic gyp environment variables. These are used by |
| 7 gyp_chromium and landmines.py which run at different stages of runhooks. To | 7 gyp_chromium and landmines.py which run at different stages of runhooks. To |
| 8 make sure settings are consistent between them, all setup should happen here. | 8 make sure settings are consistent between them, all setup should happen here. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import gyp_helper | 11 import gyp_helper |
| 12 import mac_toolchain | |
| 13 import os | 12 import os |
| 14 import sys | 13 import sys |
| 15 import vs_toolchain | 14 import vs_toolchain |
| 16 | 15 |
| 17 def SetEnvironment(): | 16 def SetEnvironment(): |
| 18 """Sets defaults for GYP_* variables.""" | 17 """Sets defaults for GYP_* variables.""" |
| 19 gyp_helper.apply_chromium_gyp_env() | 18 gyp_helper.apply_chromium_gyp_env() |
| 20 | 19 |
| 21 # Default to ninja on linux and windows, but only if no generator has | 20 # Default to ninja on linux and windows, but only if no generator has |
| 22 # explicitly been set. | 21 # explicitly been set. |
| 23 # Also default to ninja on mac, but only when not building chrome/ios. | 22 # Also default to ninja on mac, but only when not building chrome/ios. |
| 24 # . -f / --format has precedence over the env var, no need to check for it | 23 # . -f / --format has precedence over the env var, no need to check for it |
| 25 # . set the env var only if it hasn't been set yet | 24 # . set the env var only if it hasn't been set yet |
| 26 # . chromium.gyp_env has been applied to os.environ at this point already | 25 # . chromium.gyp_env has been applied to os.environ at this point already |
| 27 if sys.platform.startswith(('linux', 'win', 'freebsd', 'darwin')) and \ | 26 if sys.platform.startswith(('linux', 'win', 'freebsd', 'darwin')) and \ |
| 28 not os.environ.get('GYP_GENERATORS'): | 27 not os.environ.get('GYP_GENERATORS'): |
| 29 os.environ['GYP_GENERATORS'] = 'ninja' | 28 os.environ['GYP_GENERATORS'] = 'ninja' |
| 30 | 29 |
| 31 vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() | 30 vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() |
| 32 mac_toolchain.SetToolchainEnvironment() | |
| OLD | NEW |