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

Side by Side Diff: infra/bots/recipe_modules/flavor/gn_android_flavor.py

Issue 2298203002: GN: forgot Clang+ccache fix on Android. And sort. (Closed)
Patch Set: Created 4 years, 3 months 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
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-mipsel-Debug-GN_Android.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 import default_flavor 5 import default_flavor
6 6
7 """GN Android flavor utils, used for building Skia for Android with GN.""" 7 """GN Android flavor utils, used for building Skia for Android with GN."""
8 class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils): 8 class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
9 def supported(self): 9 def supported(self):
10 return 'GN_Android' == self.m.vars.builder_cfg.get('extra_config', '') 10 return 'GN_Android' == self.m.vars.builder_cfg.get('extra_config', '')
11 11
12 def compile(self, unused_target, **kwargs): 12 def compile(self, unused_target, **kwargs):
13 compiler = self.m.vars.builder_cfg.get('compiler') 13 compiler = self.m.vars.builder_cfg.get('compiler')
14 configuration = self.m.vars.builder_cfg.get('configuration') 14 configuration = self.m.vars.builder_cfg.get('configuration')
15 os = self.m.vars.builder_cfg.get('os') 15 os = self.m.vars.builder_cfg.get('os')
16 target_arch = self.m.vars.builder_cfg.get('target_arch') 16 target_arch = self.m.vars.builder_cfg.get('target_arch')
17 17
18 assert compiler == 'Clang' # At this rate we might not ever support GCC. 18 assert compiler == 'Clang' # At this rate we might not ever support GCC.
19 19
20 compiler_prefix = '' 20 compiler_prefix = ''
21 extra_cflags = []
21 ccache = self.m.run.ccache() 22 ccache = self.m.run.ccache()
22 if ccache: 23 if ccache:
23 compiler_prefix = ccache 24 compiler_prefix = ccache
25 extra_cflags.append('-Qunused-arguments')
24 26
25 ndk_asset = 'android_ndk_linux' if os == 'Ubuntu' else 'android_ndk_darwin' 27 ndk_asset = 'android_ndk_linux' if os == 'Ubuntu' else 'android_ndk_darwin'
26 28
27 quote = lambda x: '"%s"' % x 29 quote = lambda x: '"%s"' % x
28 gn_args = ' '.join('%s=%s' % (k,v) for (k,v) in { 30 gn_args = ' '.join('%s=%s' % (k,v) for (k,v) in sorted({
29 'compiler_prefix': quote(compiler_prefix), 31 'compiler_prefix': quote(compiler_prefix),
32 'extra_cflags': quote(' '.join(extra_cflags)),
30 'is_debug': 'true' if configuration == 'Debug' else 'false', 33 'is_debug': 'true' if configuration == 'Debug' else 'false',
31 'ndk': quote(self.m.vars.slave_dir.join(ndk_asset)), 34 'ndk': quote(self.m.vars.slave_dir.join(ndk_asset)),
32 'target_cpu': quote(target_arch), 35 'target_cpu': quote(target_arch),
33 }.iteritems()) 36 }.iteritems()))
34 37
35 run = lambda title, cmd: self.m.run(self.m.step, title, cmd=cmd, 38 run = lambda title, cmd: self.m.run(self.m.step, title, cmd=cmd,
36 cwd=self.m.vars.skia_dir, **kwargs) 39 cwd=self.m.vars.skia_dir, **kwargs)
37 40
38 run('fetch-gn', [self.m.vars.skia_dir.join('bin', 'fetch-gn')]) 41 run('fetch-gn', [self.m.vars.skia_dir.join('bin', 'fetch-gn')])
39 run('gn gen', ['gn', 'gen', self.out_dir, '--args=' + gn_args]) 42 run('gn gen', ['gn', 'gen', self.out_dir, '--args=' + gn_args])
40 run('ninja', ['ninja', '-C', self.out_dir]) 43 run('ninja', ['ninja', '-C', self.out_dir])
OLDNEW
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-mipsel-Debug-GN_Android.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698