Chromium Code Reviews| 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 from slave.recipe_config import config_item_context, ConfigGroup | 5 from slave.recipe_config import config_item_context, ConfigGroup |
| 6 from slave.recipe_config import Dict, Single, Static, Set, BadConf | 6 from slave.recipe_config import Dict, Single, Static, Set, BadConf |
| 7 from slave.recipe_config_types import Path | 7 from slave.recipe_config_types import Path |
| 8 | 8 |
| 9 # Because of the way that we use decorators, pylint can't figure out the proper | 9 # Because of the way that we use decorators, pylint can't figure out the proper |
| 10 # type signature of functions annotated with the @config_ctx decorator. | 10 # type signature of functions annotated with the @config_ctx decorator. |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 def BaseConfig(HOST_PLATFORM, HOST_ARCH, HOST_BITS, | 25 def BaseConfig(HOST_PLATFORM, HOST_ARCH, HOST_BITS, |
| 26 TARGET_PLATFORM, TARGET_ARCH, TARGET_BITS, | 26 TARGET_PLATFORM, TARGET_ARCH, TARGET_BITS, |
| 27 BUILD_CONFIG, **_kwargs): | 27 BUILD_CONFIG, **_kwargs): |
| 28 equal_fn = lambda tup: ('%s=%s' % tup) | 28 equal_fn = lambda tup: ('%s=%s' % tup) |
| 29 return ConfigGroup( | 29 return ConfigGroup( |
| 30 compile_py = ConfigGroup( | 30 compile_py = ConfigGroup( |
| 31 default_targets = Set(basestring), | 31 default_targets = Set(basestring), |
| 32 build_tool = Single(basestring), | 32 build_tool = Single(basestring), |
| 33 compiler = Single(basestring, required=False), | 33 compiler = Single(basestring, required=False), |
| 34 mode = Single(basestring, required=False), | 34 mode = Single(basestring, required=False), |
| 35 goma_dir = Single(Path, required=False), | |
| 35 clobber = Single(bool, empty_val=False, required=False, hidden=False), | 36 clobber = Single(bool, empty_val=False, required=False, hidden=False), |
| 36 ), | 37 ), |
| 37 gyp_env = ConfigGroup( | 38 gyp_env = ConfigGroup( |
| 38 GYP_CROSSCOMPILE = Single(int, jsonish_fn=str, required=False), | 39 GYP_CROSSCOMPILE = Single(int, jsonish_fn=str, required=False), |
| 39 GYP_DEFINES = Dict(equal_fn, ' '.join, (basestring,int,Path)), | 40 GYP_DEFINES = Dict(equal_fn, ' '.join, (basestring,int,Path)), |
| 40 GYP_GENERATORS = Set(basestring, ','.join), | 41 GYP_GENERATORS = Set(basestring, ','.join), |
| 41 GYP_GENERATOR_FLAGS = Dict(equal_fn, ' '.join, (basestring,int)), | 42 GYP_GENERATOR_FLAGS = Dict(equal_fn, ' '.join, (basestring,int)), |
| 42 GYP_MSVS_VERSION = Single(basestring, required=False), | 43 GYP_MSVS_VERSION = Single(basestring, required=False), |
| 43 ), | 44 ), |
| 44 build_dir = Single(Path), | 45 build_dir = Single(Path), |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 raise BadConf('goma doesn\'t work with msvs') | 186 raise BadConf('goma doesn\'t work with msvs') |
| 186 | 187 |
| 187 # TODO(iannucci): support clang and jsonclang | 188 # TODO(iannucci): support clang and jsonclang |
| 188 if not c.compile_py.compiler: | 189 if not c.compile_py.compiler: |
| 189 c.compile_py.compiler = 'goma' | 190 c.compile_py.compiler = 'goma' |
| 190 elif c.compile_py.compiler == 'clang': | 191 elif c.compile_py.compiler == 'clang': |
| 191 c.compile_py.compiler = 'goma-clang' | 192 c.compile_py.compiler = 'goma-clang' |
| 192 else: # pragma: no cover | 193 else: # pragma: no cover |
| 193 raise BadConf('goma config dosen\'t understand %s' % c.compile_py.compiler) | 194 raise BadConf('goma config dosen\'t understand %s' % c.compile_py.compiler) |
| 194 | 195 |
| 196 c.gyp_env.GYP_DEFINES['use_goma'] = 1 | |
| 197 | |
| 198 goma_dir = Path('[BUILD]', 'goma') | |
|
Nico
2014/02/04 19:57:02
To make sure: [BUILD] evaluates to the root of the
Paweł Hajdan Jr.
2014/02/04 20:40:15
Yes. I tested this locally.
| |
| 199 c.gyp_env.GYP_DEFINES['gomadir'] = goma_dir | |
| 200 c.compile_py.goma_dir = goma_dir | |
| 201 | |
| 195 if c.TARGET_PLATFORM == 'win': | 202 if c.TARGET_PLATFORM == 'win': |
| 196 fastbuild(c) | 203 fastbuild(c) |
| 197 pch(c, invert=True) | 204 pch(c, invert=True) |
| 198 | 205 |
| 199 @config_ctx() | 206 @config_ctx() |
| 200 def pch(c, invert=False): | 207 def pch(c, invert=False): |
| 201 if c.TARGET_PLATFORM == 'win': | 208 if c.TARGET_PLATFORM == 'win': |
| 202 c.gyp_env.GYP_DEFINES['chromium_win_pch'] = int(not invert) | 209 c.gyp_env.GYP_DEFINES['chromium_win_pch'] = int(not invert) |
| 203 | 210 |
| 204 @config_ctx() | 211 @config_ctx() |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 @config_ctx(includes=['chromium_clang']) | 315 @config_ctx(includes=['chromium_clang']) |
| 309 def blink_clang(c): | 316 def blink_clang(c): |
| 310 c.compile_py.default_targets = ['blink_tests'] | 317 c.compile_py.default_targets = ['blink_tests'] |
| 311 | 318 |
| 312 @config_ctx(includes=['ninja', 'static_library', 'default_compiler', 'goma']) | 319 @config_ctx(includes=['ninja', 'static_library', 'default_compiler', 'goma']) |
| 313 def android(c): | 320 def android(c): |
| 314 gyp_defs = c.gyp_env.GYP_DEFINES | 321 gyp_defs = c.gyp_env.GYP_DEFINES |
| 315 gyp_defs['fastbuild'] = 1 | 322 gyp_defs['fastbuild'] = 1 |
| 316 gyp_defs['OS'] = c.TARGET_PLATFORM | 323 gyp_defs['OS'] = c.TARGET_PLATFORM |
| 317 gyp_defs['host_os'] = c.HOST_PLATFORM | 324 gyp_defs['host_os'] = c.HOST_PLATFORM |
| OLD | NEW |