OLD | NEW |
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 re | 5 import re |
6 | 6 |
7 import default_flavor | 7 import default_flavor |
8 | 8 |
9 | 9 |
10 """PDFium flavor utils, used for building PDFium with Skia.""" | 10 """PDFium flavor utils, used for building PDFium with Skia.""" |
11 | 11 |
12 | 12 |
13 class PDFiumFlavorUtils(default_flavor.DefaultFlavorUtils): | 13 class PDFiumFlavorUtils(default_flavor.DefaultFlavorUtils): |
14 | 14 |
15 def compile(self, target, **kwargs): | 15 def compile(self, target, **kwargs): |
16 """Build PDFium with Skia.""" | 16 """Build PDFium with Skia.""" |
17 pdfium_dir = self.m.vars.checkout_root.join('pdfium') | 17 pdfium_dir = self.m.vars.checkout_root.join('pdfium') |
18 | 18 |
19 # Runhook to generate the gn binary in buildtools. | 19 # Runhook to generate the gn binary in buildtools. |
20 self.m.run( | 20 self.m.run( |
21 self.m.step, | 21 self.m.step, |
22 'runhook', | 22 'runhook', |
23 cmd=['gclient', 'runhook', 'gn_linux64'], | 23 cmd=['gclient', 'runhook', 'gn_linux64'], |
24 cwd=pdfium_dir, | 24 cwd=pdfium_dir, |
25 **kwargs) | 25 **kwargs) |
26 | 26 |
27 # Setup gn args. | 27 # Setup gn args. |
28 gn_args = ['pdf_use_skia=true', 'pdf_is_standalone=true', | 28 gn_args = [ |
29 'clang_use_chrome_plugins=false'] | 29 'pdf_use_skia=true', |
| 30 'pdf_is_standalone=true', |
| 31 'clang_use_chrome_plugins=false', |
| 32 'is_component_build=false', |
| 33 'is_debug=false', |
| 34 ] |
| 35 |
| 36 |
30 env = kwargs.pop('env', {}) | 37 env = kwargs.pop('env', {}) |
31 env['CHROMIUM_BUILDTOOLS_PATH'] = str(pdfium_dir.join('buildtools')) | 38 env['CHROMIUM_BUILDTOOLS_PATH'] = str(pdfium_dir.join('buildtools')) |
32 self.m.run( | 39 self.m.run( |
33 self.m.step, | 40 self.m.step, |
34 'gn_gen', | 41 'gn_gen', |
35 cmd=['gn', 'gen', 'out/skia', '--args=%s' % ' '.join(gn_args)], | 42 cmd=['gn', 'gen', 'out/skia', '--args=%s' % ' '.join(gn_args)], |
36 cwd=pdfium_dir, | 43 cwd=pdfium_dir, |
37 env=env) | 44 env=env) |
38 | 45 |
39 # Modify DEPS file to contain the current Skia revision. | 46 # Modify DEPS file to contain the current Skia revision. |
(...skipping 20 matching lines...) Expand all Loading... |
60 cwd=pdfium_dir) | 67 cwd=pdfium_dir) |
61 | 68 |
62 # Build PDFium. | 69 # Build PDFium. |
63 self.m.run( | 70 self.m.run( |
64 self.m.step, | 71 self.m.step, |
65 'build_pdfium', | 72 'build_pdfium', |
66 cmd=['ninja', '-C', 'out/skia', '-j100'], | 73 cmd=['ninja', '-C', 'out/skia', '-j100'], |
67 cwd=pdfium_dir, | 74 cwd=pdfium_dir, |
68 env=env, | 75 env=env, |
69 **kwargs) | 76 **kwargs) |
OLD | NEW |