OLD | NEW |
1 # PDFium | 1 # PDFium |
2 | 2 |
3 ## News | 3 ## News |
4 | 4 |
5 As of 2016-02-04, the XFA branch is deprecated. Instead, see | 5 As of 2016-02-04, the XFA branch is deprecated. Instead, see the section on |
6 [the section on configuration](#BuildConfig) below. | 6 configuration below. |
7 | |
8 As of 2016-04-15, Visual Studio toolchain from depot_tools will be used as the | |
9 default. Set DEPOT_TOOLS_WIN_TOOLCHAIN=0 if you need to use system toolchain. | |
10 See [Windows development subsection](#WinDev) for details. | |
11 | |
12 | 7 |
13 ## Prerequisites | 8 ## Prerequisites |
14 | 9 |
15 Get the chromium depot tools via the instructions at | 10 Get the chromium depot tools via the instructions at |
16 http://www.chromium.org/developers/how-tos/install-depot-tools (this provides | 11 http://www.chromium.org/developers/how-tos/install-depot-tools (this provides |
17 the gclient utilty needed below). | 12 the gclient utilty needed below). |
18 | 13 |
19 Also install Python, Subversion, and Git and make sure they're in your path. | 14 Also install Python, Subversion, and Git and make sure they're in your path. |
20 | 15 |
21 ###<a name="WinDev"></a> Windows development | |
22 | |
23 PDFium uses similar Windows toolchain as Chromium: | |
24 | |
25 #### Open source contributors: | |
26 Visual Studio 2015 Update 2 or later is highly recommended. | |
27 | |
28 Run `set DEPOT_TOOLS_WIN_TOOLCHAIN=0`, or set that variable in your global | |
29 environment. | |
30 | |
31 Compilation is done through ninja, **not** Visual Studio. | |
32 | |
33 #### Google employees | |
34 | |
35 Run: `download_from_google_storage --config` and follow the | |
36 authentication instructions. **Note that you must authenticate with your | |
37 @google.com credentials**. Enter "0" if asked for a project-id. | |
38 | |
39 Once you've done this, the toolchain will be installed automatically for | |
40 you in Step 3, below (near the end of the step). | |
41 | |
42 The toolchain will be in `depot_tools\win_toolchain`, and windbg can be | |
43 found in `depot_tools\win_toolchain\vs2013_files\win8sdk\Debuggers`. | |
44 | |
45 If you want the IDE for debugging and editing, you will need to install | |
46 it separately, but this is optional and not needed to build PDFium. | |
47 | |
48 | |
49 ## Get the code | 16 ## Get the code |
50 | 17 |
51 The name of the top-level directory does not matter. In our examples, we use | 18 The name of the top-level directory does not matter. In our examples, we use |
52 "repo". This directory must not have been used before by `gclient config` as | 19 "repo". This directory must not have been used before by `gclient config` as |
53 each directory can only house a single gclient configuration. | 20 each directory can only house a single gclient configuration. |
54 | 21 |
55 ``` | 22 ``` |
56 mkdir repo | 23 mkdir repo |
57 cd repo | 24 cd repo |
58 gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git | 25 gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git |
(...skipping 13 matching lines...) Expand all Loading... |
72 (http://build.chromium.org/p/client.pdfium/). | 39 (http://build.chromium.org/p/client.pdfium/). |
73 | 40 |
74 * On Windows: `build\gyp_pdfium` | 41 * On Windows: `build\gyp_pdfium` |
75 * For all other platforms: `build/gyp_pdfium` | 42 * For all other platforms: `build/gyp_pdfium` |
76 | 43 |
77 The second option is to generate platform-specific build files, i.e. Makefiles | 44 The second option is to generate platform-specific build files, i.e. Makefiles |
78 on Linux, sln files on Windows, and xcodeproj files on Mac. To do so, set the | 45 on Linux, sln files on Windows, and xcodeproj files on Mac. To do so, set the |
79 GYP\_GENERATORS environment variable appropriately (e.g. "make", "msvs", or | 46 GYP\_GENERATORS environment variable appropriately (e.g. "make", "msvs", or |
80 "xcode") before running the above command. | 47 "xcode") before running the above command. |
81 | 48 |
82 ###<a name="BuildConfig"></a> Selecting build configuration | 49 ### Selecting build configuration |
83 | 50 |
84 PDFium may be built either with or without JavaScript support, and with | 51 PDFium may be built either with or without JavaScript support, and with |
85 or without XFA forms support. Both of these features are enabled by | 52 or without XFA forms support. Both of these features are enabled by |
86 default. Also note that the XFA feature requires JavaScript. | 53 default. Also note that the XFA feature requires JavaScript. |
87 | 54 |
88 To build without XFA, set `pdf_enable_xfa=0` before running `gyp_pdfium`. | 55 To build without XFA, set `pdf_enable_xfa=0` before running `gyp_pdfium`. |
89 To build without JavaScript, set `pdf_enable_v8=0 pdf_enable_xfa=0` before | 56 To build without JavaScript, set `pdf_enable_v8=0 pdf_enable_xfa=0` before |
90 running `gyp_pdfium`. For example | 57 running `gyp_pdfium`. For example |
91 ``` | 58 ``` |
92 GYP_DEFINES='pdf_enable_v8=0 pdf_enable_xfa=0' build/gyp_pdfium | 59 GYP_DEFINES='pdf_enable_v8=0 pdf_enable_xfa=0' build/gyp_pdfium |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 as much as possible. The main exceptions is: | 134 as much as possible. The main exceptions is: |
168 | 135 |
169 1. Code has to conform to the existing style and not Chromium/Google style. | 136 1. Code has to conform to the existing style and not Chromium/Google style. |
170 | 137 |
171 ## Branches | 138 ## Branches |
172 | 139 |
173 Prior to 2016-02-04, there existed an actively developed origin/xfa branch. | 140 Prior to 2016-02-04, there existed an actively developed origin/xfa branch. |
174 The origin/xfa branch is now an evolutionary dead-end. Everything you need | 141 The origin/xfa branch is now an evolutionary dead-end. Everything you need |
175 to build either with or without the XFA feature is on origin/master. | 142 to build either with or without the XFA feature is on origin/master. |
176 | 143 |
OLD | NEW |