Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: scripts/slave/recipe_modules/chromium_android/chromium_config.py

Issue 59233015: Make gyp target_arch setting native to chromium/config.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_types import Path 5 from slave.recipe_config_types import Path
6 from slave import recipe_config
6 7
7 from RECIPE_MODULES.chromium import CONFIG_CTX 8 from RECIPE_MODULES.chromium import CONFIG_CTX
8 9
9 @CONFIG_CTX(includes=['ninja', 'static_library']) 10 @CONFIG_CTX(includes=['ninja', 'static_library'],
11 config_vars={'TARGET_ARCH': 'arm', 'TARGET_BITS': 32})
10 def android_defaults(c): 12 def android_defaults(c):
11 c.compile_py.default_targets=['All'] 13 c.compile_py.default_targets=['All']
12 c.gyp_env.GYP_CROSSCOMPILE = 1 14 c.gyp_env.GYP_CROSSCOMPILE = 1
13 c.gyp_env.GYP_GENERATORS.add('ninja') 15 c.gyp_env.GYP_GENERATORS.add('ninja')
14 c.gyp_env.GYP_GENERATOR_FLAGS['default_target'] = 'All' 16 c.gyp_env.GYP_GENERATOR_FLAGS['default_target'] = 'All'
15 gyp_defs = c.gyp_env.GYP_DEFINES 17 gyp_defs = c.gyp_env.GYP_DEFINES
16 gyp_defs['fastbuild'] = 1 18 gyp_defs['fastbuild'] = 1
17 gyp_defs['OS'] = 'android' 19 gyp_defs['OS'] = 'android'
18 gyp_defs['host_os'] = 'linux' 20 gyp_defs['host_os'] = 'linux'
19 gyp_defs['gcc_version'] = 46 21 gyp_defs['gcc_version'] = 46
20 gyp_defs['order_text_section'] = Path( 22 gyp_defs['order_text_section'] = Path(
21 '[CHECKOUT]', 'orderfiles', 'orderfile.out') 23 '[CHECKOUT]', 'orderfiles', 'orderfile.out')
22 gyp_defs['target_arch'] = 'arm' 24
25 if c.HOST_PLATFORM != 'linux':
26 raise recipe_config.BadConf('Can only build android on linux.')
27 if c.TARGET_BITS != 32:
28 raise recipe_config.BadConf('Android cannot targit %d bits' % c.TARGET_BITS)
ghost stip (do not use) 2013/11/08 20:11:18 target
iannucci 2013/11/12 02:16:36 Lol. Done.
23 29
24 30
25 @CONFIG_CTX(includes=['android_defaults', 'default_compiler', 'goma']) 31 @CONFIG_CTX(includes=['android_defaults', 'default_compiler', 'goma'])
26 def main_builder(c): 32 def main_builder(c):
ghost stip (do not use) 2013/11/08 20:11:18 maybe rename this to arm_builder?
iannucci 2013/11/12 02:16:36 I'd prefer to leave that to another CL. main_build
27 pass 33 if c.TARGET_ARCH != 'arm':
34 raise recipe_config.BadConf(
35 'Cannot target arm with TARGET_ARCH == %s' % c.TARGET_ARCH)
28 36
29 @CONFIG_CTX(includes=['android_defaults', 'clang', 'goma']) 37 @CONFIG_CTX(includes=['android_defaults', 'clang', 'goma'])
30 def clang_builder(c): 38 def clang_builder(c):
31 pass 39 pass
32 40
33 @CONFIG_CTX(includes=['main_builder']) 41 @CONFIG_CTX(includes=['main_builder'])
34 def component_builder(c): 42 def component_builder(c):
35 c.gyp_env.GYP_DEFINES['component'] = 'shared_library' 43 c.gyp_env.GYP_DEFINES['component'] = 'shared_library'
36 44
37 @CONFIG_CTX(includes=['main_builder']) 45 @CONFIG_CTX(includes=['android_defaults', 'default_compiler', 'goma'],
46 config_vars={'TARGET_ARCH': 'intel'})
38 def x86_builder(c): 47 def x86_builder(c):
39 c.gyp_env.GYP_DEFINES['target_arch'] = 'ia32' 48 if c.TARGET_ARCH != 'intel':
49 raise recipe_config.BadConf(
50 'Cannot target x86 with TARGET_ARCH == %s' % c.TARGET_ARCH)
40 51
41 @CONFIG_CTX(includes=['main_builder']) 52 @CONFIG_CTX(includes=['main_builder'])
42 def klp_builder(c): 53 def klp_builder(c):
43 gyp_defs = c.gyp_env.GYP_DEFINES 54 gyp_defs = c.gyp_env.GYP_DEFINES
44 gyp_defs['android_sdk_version'] = '4.4' 55 gyp_defs['android_sdk_version'] = '4.4'
45 gyp_defs['android_sdk_root'] = Path( 56 gyp_defs['android_sdk_root'] = Path(
46 '[CHECKOUT]', 'third_party', 'android_tools_internal', 'sdk') 57 '[CHECKOUT]', 'third_party', 'android_tools_internal', 'sdk')
47 58
48 @CONFIG_CTX(includes=['main_builder']) 59 @CONFIG_CTX(includes=['main_builder'])
49 def try_builder(c): 60 def try_builder(c):
50 pass 61 pass
51 62
52 @CONFIG_CTX(includes=['x86_builder', 'try_builder']) 63 @CONFIG_CTX(includes=['x86_builder'])
ghost stip (do not use) 2013/11/08 20:11:18 won't this mean x86_try_builder won't get apply_is
iannucci 2013/11/12 02:16:36 no, the recipes check to see if 'try' is in the bu
53 def x86_try_builder(c): 64 def x86_try_builder(c):
54 pass 65 pass
55 66
56 @CONFIG_CTX(includes=['android_defaults']) 67 @CONFIG_CTX(includes=['android_defaults'])
57 def tests_base(c): 68 def tests_base(c):
58 pass 69 pass
59 70
60 @CONFIG_CTX(includes=['tests_base']) 71 @CONFIG_CTX(includes=['tests_base'])
61 def main_tests(c): 72 def main_tests(c):
62 pass 73 pass
63 74
64 @CONFIG_CTX(includes=['tests_base']) 75 @CONFIG_CTX(includes=['tests_base'])
65 def clang_tests(c): 76 def clang_tests(c):
66 pass 77 pass
67 78
68 @CONFIG_CTX(includes=['tests_base']) 79 @CONFIG_CTX(includes=['tests_base'])
69 def enormous_tests(c): 80 def enormous_tests(c):
70 pass 81 pass
71 82
72 @CONFIG_CTX(includes=['tests_base']) 83 @CONFIG_CTX(includes=['tests_base'])
73 def try_instrumentation_tests(c): 84 def try_instrumentation_tests(c):
74 pass 85 pass
75 86
76 @CONFIG_CTX(includes=['tests_base']) 87 @CONFIG_CTX(includes=['x86_builder'])
77 def x86_try_instrumentation_tests(c): 88 def x86_try_instrumentation_tests(c):
78 pass 89 pass
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698