Chromium Code Reviews| 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 | |
| 9 class GNFlavorUtils(default_flavor.DefaultFlavorUtils): | |
| 10 def compile(self, target): | |
| 11 """Build Skia with GN.""" | |
| 12 # Get the gn executable. | |
| 13 fetch_gn= self._skia_api.skia_dir.join('bin', 'fetch_gn') | |
| 14 self._skia_api.run(self._skia_api.m.step, 'fetch-gn', cmd=[fetch_gn], | |
| 15 cwd=self._skia_api.m.path['checkout']) | |
|
borenet
2016/07/27 19:51:37
Prefer cwd=self._skia_api.skia_dir here and below.
jcgregorio
2016/07/27 20:01:01
Done.
| |
| 16 | |
| 17 is_debug = 'is_debug=' + ( | |
| 18 'true' if self.configuration == 'Debug' else 'false' | |
|
borenet
2016/07/27 19:51:37
Does self.configuration exist? It might need to b
jcgregorio
2016/07/27 20:01:01
Done.
| |
| 19 ) | |
|
borenet
2016/07/27 19:51:37
Indent?
jcgregorio
2016/07/27 20:01:01
Did in a different way.
| |
| 20 gn_args = [is_debug] | |
| 21 out_dir = 'out/%d' % self.configuration | |
| 22 # Run gn gen out/BUILDTYPE --args="is_debug=true" | |
| 23 gn_gen = ['gn', 'gen', out_dir, '--args=%s' % ' '.join(gn_args)] | |
|
borenet
2016/07/27 19:51:37
It may not matter yet, but if it's "gn.exe" on win
jcgregorio
2016/07/27 20:01:01
Fixed.
| |
| 24 self._skia_api.run(self._skia_api.m.step, 'gn_gen', cmd=gn_gen, | |
| 25 cwd=self._skia_api.m.path['checkout']) | |
| 26 | |
| 27 # Run ninja | |
| 28 ninja_cmd = ['ninja', '-C', out_dir, 'skia'], | |
| 29 self._skia_api.run(self._skia_api.m.step, 'compile %s' % target, | |
| 30 cmd=ninja_cmd, | |
| 31 cwd=self._skia_api.m.path['checkout']) | |
| OLD | NEW |