Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # PDFium | 1 # PDFium |
| 2 | 2 |
| 3 ## News | 3 ## News |
| 4 | 4 |
| 5 As of 2016-05-04, GN is used to generate build files replacing GYP. GYP | 5 As of 2016-05-04, GN is used to generate build files replacing GYP. GYP |
| 6 support will remain until it is disabled in Chromium and then will be removed | 6 support will remain until it is disabled in Chromium and then will be removed |
| 7 from PDFium. | 7 from PDFium. |
| 8 | 8 |
| 9 As of 2016-04-28, the Visual Studio toolchain from depot_tools is used as the | 9 As of 2016-04-28, the Visual Studio toolchain from depot_tools is used as the |
| 10 default Windows toolchain for Googlers. Please set DEPOT_TOOLS_WIN_TOOLCHAIN=0 | 10 default Windows toolchain for Googlers. Please set DEPOT_TOOLS_WIN_TOOLCHAIN=0 |
| 11 if you need to use the system toolchain. See | 11 if you need to use the system toolchain. See |
| 12 [Windows development subsection](#WinDev) for details. | 12 [Windows development subsection](#WinDev) for details. |
| 13 | 13 |
| 14 | 14 |
| 15 ## Prerequisites | 15 ## Prerequisites |
| 16 | 16 |
| 17 Get the chromium depot tools via the instructions at | 17 Get the chromium depot tools via the instructions at |
| 18 http://www.chromium.org/developers/how-tos/install-depot-tools (this provides | 18 http://www.chromium.org/developers/how-tos/install-depot-tools (this provides |
| 19 the gclient utilty needed below). | 19 the gclient utility needed below). |
| 20 | 20 |
| 21 Also install Python, Subversion, and Git and make sure they're in your path. | 21 Also install Python, Subversion, and Git and make sure they're in your path. |
| 22 | 22 |
| 23 | 23 |
| 24 ###<a name="WinDev"></a> Windows development | 24 ###<a name="WinDev"></a> Windows development |
| 25 | 25 |
| 26 PDFium uses a similar Windows toolchain as Chromium: | 26 PDFium uses a similar Windows toolchain as Chromium: |
| 27 | 27 |
| 28 #### Open source contributors | 28 #### Open source contributors |
| 29 Visual Studio 2015 Update 2 or later is highly recommended. | 29 Visual Studio 2015 Update 2 or later is highly recommended. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 We use GN to generate the build files and | 69 We use GN to generate the build files and |
| 70 [Ninja](http://martine.github.io/ninja/) (also included with the depot\_tools | 70 [Ninja](http://martine.github.io/ninja/) (also included with the depot\_tools |
| 71 checkout) to execute the build files. | 71 checkout) to execute the build files. |
| 72 | 72 |
| 73 ``` | 73 ``` |
| 74 gn gen <directory> | 74 gn gen <directory> |
| 75 ``` | 75 ``` |
| 76 | 76 |
| 77 If you want to set <directory> to `out/Debug` or `out/Release` you'll need to | 77 If you want to set <directory> to `out/Debug` or `out/Release` you'll need to |
| 78 export `GYP_PDFIUM_NO_ACTION=1` to stop `gclient sync` from executing GYP | 78 export `GYP_PDFIUM_NO_ACTION=1` to stop `gclient sync` from executing GYP |
| 79 and overwritting your build files. | 79 and overwriting your build files. |
| 80 | 80 |
| 81 ###<a name="BuildConfig"></a> Selecting build configuration | 81 ###<a name="BuildConfig"></a> Selecting build configuration |
| 82 | 82 |
| 83 PDFium may be built either with or without JavaScript support, and with | 83 PDFium may be built either with or without JavaScript support, and with |
| 84 or without XFA forms support. Both of these features are enabled by | 84 or without XFA forms support. Both of these features are enabled by |
| 85 default. Also note that the XFA feature requires JavaScript. | 85 default. Also note that the XFA feature requires JavaScript. |
| 86 | 86 |
| 87 Configuration is done by executing `gn args <directory>` to configure the build. | 87 Configuration is done by executing `gn args <directory>` to configure the build. |
| 88 This will lauch an editor in which you can set the following arguments. | 88 This will launch an editor in which you can set the following arguments. |
| 89 | 89 |
| 90 ``` | 90 ``` |
| 91 use_goma = true # Googlers only. | 91 use_goma = true # Googlers only. |
| 92 is_debug = true # Enable debugging features. | 92 is_debug = true # Enable debugging features. |
| 93 | 93 |
| 94 pdf_use_skia = false # Set true to enable experimental skia backend. | 94 pdf_use_skia = false # Set true to enable experimental skia backend. |
| 95 | 95 |
| 96 pdf_enable_xfa = true # Set false to remove XFA support (implies JS support). | 96 pdf_enable_xfa = true # Set false to remove XFA support (implies JS support). |
| 97 pdf_enable_v8 = true # Set false to remove Javascript support. | 97 pdf_enable_v8 = true # Set false to remove Javascript support. |
| 98 pdf_is_standalone = true # Set for a non-embedded build. | 98 pdf_is_standalone = true # Set for a non-embedded build. |
|
Tom Sepez
2016/05/16 16:07:59
should this say "Set false for a non-embedded buil
dsinclair
2016/05/16 18:40:29
I don't think so, we want this true if we aren't e
| |
| 99 | 99 |
| 100 clang_use_chrome_plugins = false # Currently must be false. | 100 clang_use_chrome_plugins = false # Currently must be false. |
| 101 ``` | 101 ``` |
| 102 | 102 |
| 103 Note, you must set `pdf_is_standalone = true` if you want the sample | |
| 104 applications like `pdfium_test` to build. | |
| 105 | |
| 103 When complete the arguments will be stored in `<directory>/args.gn`. | 106 When complete the arguments will be stored in `<directory>/args.gn`. |
| 104 | 107 |
| 105 ## Building the code | 108 ## Building the code |
| 106 | 109 |
| 107 If you used Ninja, you can build the sample program by: | 110 If you used Ninja, you can build the sample program by: |
| 108 `ninja -C <directory>/pdfium_test` You can build the entire product (which | 111 `ninja -C <directory>/pdfium_test` You can build the entire product (which |
| 109 includes a few unit tests) by: `ninja -C <directory>`. | 112 includes a few unit tests) by: `ninja -C <directory>`. |
| 110 | 113 |
| 111 | 114 |
| 112 ## Running the sample program | 115 ## Running the sample program |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 and add the "Cr-Internals-Plugins-PDF" label. | 158 and add the "Cr-Internals-Plugins-PDF" label. |
| 156 | 159 |
| 157 ## Contributing code | 160 ## Contributing code |
| 158 | 161 |
| 159 For contributing code, we will follow | 162 For contributing code, we will follow |
| 160 [Chromium's process](http://dev.chromium.org/developers/contributing-code) | 163 [Chromium's process](http://dev.chromium.org/developers/contributing-code) |
| 161 as much as possible. The main exceptions is: | 164 as much as possible. The main exceptions is: |
| 162 | 165 |
| 163 1. Code has to conform to the existing style and not Chromium/Google style. | 166 1. Code has to conform to the existing style and not Chromium/Google style. |
| 164 | 167 |
| OLD | NEW |