OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 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 30 matching lines...) Expand all Loading... |
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 @memoize() | 50 @memoize() |
51 def gyp_generator_flags(): | |
52 """Parses and returns GYP_GENERATOR_FLAGS env var as a dictionary.""" | |
53 return dict(arg.split('=', 1) | |
54 for arg in shlex.split(os.environ.get('GYP_GENERATOR_FLAGS', ''))) | |
55 | |
56 @memoize() | |
57 def gyp_msvs_version(): | 51 def gyp_msvs_version(): |
58 return os.environ.get('GYP_MSVS_VERSION', '') | 52 return os.environ.get('GYP_MSVS_VERSION', '') |
59 | 53 |
60 @memoize() | 54 @memoize() |
61 def distributor(): | 55 def distributor(): |
62 """ | 56 """ |
63 Returns a string which is the distributed build engine in use (if any). | 57 Returns a string which is the distributed build engine in use (if any). |
64 Possible values: 'goma', 'ib', '' | 58 Possible values: 'goma', 'ib', '' |
65 """ | 59 """ |
66 if 'goma' in gyp_defines(): | 60 if 'goma' in gyp_defines(): |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 elif platform() == 'ios': | 105 elif platform() == 'ios': |
112 return 'xcode' | 106 return 'xcode' |
113 elif IsWindows(): | 107 elif IsWindows(): |
114 return 'ninja' | 108 return 'ninja' |
115 elif IsLinux(): | 109 elif IsLinux(): |
116 return 'ninja' | 110 return 'ninja' |
117 elif IsMac(): | 111 elif IsMac(): |
118 return 'ninja' | 112 return 'ninja' |
119 else: | 113 else: |
120 assert False, 'Don\'t know what builder we\'re using!' | 114 assert False, 'Don\'t know what builder we\'re using!' |
OLD | NEW |