OLD | NEW |
---|---|
(Empty) | |
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 | |
3 # found in the LICENSE file. | |
4 | |
5 import default_flavor | |
6 | |
7 """GN flavor utils, used for building Skia with GN.""" | |
8 class GNFlavorUtils(default_flavor.DefaultFlavorUtils): | |
9 def compile(self, target): | |
10 """Build Skia with GN.""" | |
11 # Get the gn executable. | |
12 fetch_gn = self._skia_api.skia_dir.join('bin', 'fetch_gn') | |
13 self._skia_api.run(self._skia_api.m.step, 'fetch-gn', cmd=[fetch_gn], | |
14 cwd=self._skia_api.skia_dir) | |
15 | |
16 out_dir = 'out/%s' % self._skia_api.configuration | |
borenet
2016/07/28 14:23:27
use self.out_dir instead
jcgregorio
2016/07/28 15:26:25
Done.
| |
17 | |
18 is_debug = 'is_debug=true' | |
19 if self._skia_api.configuration != 'Debug': | |
20 is_debug = 'is_debug=false' | |
21 gn_args = [is_debug] | |
22 | |
23 # Run gn gen. | |
24 gn_exe = 'gn' | |
25 if self._skia_api.m.platform.is_win: | |
26 gn_exe = 'gn.exe' | |
27 gn_gen = [gn_exe, 'gen', out_dir, '--args=%s' % ' '.join(gn_args)] | |
mtklein
2016/07/28 14:25:10
I suspect when we have more than one, we'll want
jcgregorio
2016/07/28 15:26:25
I was thinking args would just get added to gn_arg
mtklein
2016/07/28 15:30:11
Yeah, I'm on board there. I was worried about the
jcgregorio
2016/07/28 15:33:16
Yeah, it is, I copied this from the pdfium flavor
| |
28 self._skia_api.run(self._skia_api.m.step, 'gn_gen', cmd=gn_gen, | |
29 cwd=self._skia_api.skia_dir) | |
30 | |
31 # Run ninja. | |
32 ninja_cmd = ['ninja', '-C', out_dir] | |
borenet
2016/07/28 14:23:27
'ninja' probably needs to be 'ninja.exe' on Window
jcgregorio
2016/07/28 15:26:25
Windows can wait.
| |
33 self._skia_api.run(self._skia_api.m.step, 'compile %s' % target, | |
34 cmd=ninja_cmd, | |
35 cwd=self._skia_api.skia_dir) | |
OLD | NEW |