| OLD | NEW |
| 1 # Copyright 2014 the V8 project authors. All rights reserved. | 1 # Copyright 2014 the V8 project 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 import functools | 6 import functools |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import shlex | 9 import shlex |
| 10 import sys | 10 import sys |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 def IsMac(): | 40 def IsMac(): |
| 41 return sys.platform == 'darwin' | 41 return sys.platform == 'darwin' |
| 42 | 42 |
| 43 | 43 |
| 44 @memoize() | 44 @memoize() |
| 45 def gyp_defines(): | 45 def gyp_defines(): |
| 46 """Parses and returns GYP_DEFINES env var as a dictionary.""" | 46 """Parses and returns GYP_DEFINES env var as a dictionary.""" |
| 47 return dict(arg.split('=', 1) | 47 return dict(arg.split('=', 1) |
| 48 for arg in shlex.split(os.environ.get('GYP_DEFINES', ''))) | 48 for arg in shlex.split(os.environ.get('GYP_DEFINES', ''))) |
| 49 | 49 |
| 50 |
| 51 @memoize() |
| 52 def gyp_generator_flags(): |
| 53 """Parses and returns GYP_GENERATOR_FLAGS env var as a dictionary.""" |
| 54 return dict(arg.split('=', 1) |
| 55 for arg in shlex.split(os.environ.get('GYP_GENERATOR_FLAGS', ''))) |
| 56 |
| 57 |
| 50 @memoize() | 58 @memoize() |
| 51 def gyp_msvs_version(): | 59 def gyp_msvs_version(): |
| 52 return os.environ.get('GYP_MSVS_VERSION', '') | 60 return os.environ.get('GYP_MSVS_VERSION', '') |
| 53 | 61 |
| 62 |
| 54 @memoize() | 63 @memoize() |
| 55 def distributor(): | 64 def distributor(): |
| 56 """ | 65 """ |
| 57 Returns a string which is the distributed build engine in use (if any). | 66 Returns a string which is the distributed build engine in use (if any). |
| 58 Possible values: 'goma', 'ib', '' | 67 Possible values: 'goma', 'ib', '' |
| 59 """ | 68 """ |
| 60 if 'goma' in gyp_defines(): | 69 if 'goma' in gyp_defines(): |
| 61 return 'goma' | 70 return 'goma' |
| 62 elif IsWindows(): | 71 elif IsWindows(): |
| 63 if 'CHROME_HEADLESS' in os.environ: | 72 if 'CHROME_HEADLESS' in os.environ: |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 elif platform() == 'ios': | 114 elif platform() == 'ios': |
| 106 return 'xcode' | 115 return 'xcode' |
| 107 elif IsWindows(): | 116 elif IsWindows(): |
| 108 return 'msvs' | 117 return 'msvs' |
| 109 elif IsLinux(): | 118 elif IsLinux(): |
| 110 return 'make' | 119 return 'make' |
| 111 elif IsMac(): | 120 elif IsMac(): |
| 112 return 'xcode' | 121 return 'xcode' |
| 113 else: | 122 else: |
| 114 assert False, 'Don\'t know what builder we\'re using!' | 123 assert False, 'Don\'t know what builder we\'re using!' |
| OLD | NEW |