From bc6c6723c37772b02de9e6e43fa0fd9439874905 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 22 Oct 2015 14:58:54 -0400 Subject: XFA: Sync build and documentation differences with master. This Cl syncs the AUTHORS, and README.md and build scripts in XFA to match master where possible. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1415423002 . --- AUTHORS | 4 +- BUILD.gn | 113 ++++++++++++++++++++++++++++++++++++------------- README | 1 - README.md | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/build.md | 134 ---------------------------------------------------------- pdfium.gni | 1 - pdfium.gyp | 8 +++- 7 files changed, 228 insertions(+), 167 deletions(-) delete mode 100644 README create mode 100644 README.md delete mode 100644 docs/build.md diff --git a/AUTHORS b/AUTHORS index 78aad77ad9..c57cb51092 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,8 +10,10 @@ Andrey Khalyavin Brett Wilson +Bruce Dawson Chris Palmer Finnur Thorarinsson +Jiang Jiang Jochen Eisinger John Abd-El-Malek Julien Tinnes @@ -25,8 +27,8 @@ Peter Kasting Raymes Khoury Reid Kleckner Robert Sesek +Sam Clegg Thomas Sepez -Jiang Jiang Foxit Software Inc <*@foxitsoftware.com> Google Inc. <*@google.com> diff --git a/BUILD.gn b/BUILD.gn index dfb7935019..27a2b07487 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -97,7 +97,10 @@ static_library("pdfium") { libs = [] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] deps = [ "third_party:bigint", @@ -121,11 +124,18 @@ static_library("pdfium") { } if (is_win) { - libs += [ "advapi32.lib", "gdi32.lib", "user32.lib" ] + libs += [ + "advapi32.lib", + "gdi32.lib", + "user32.lib", + ] } if (is_mac) { - libs += [ "AppKit.framework", "CoreFoundation.framework" ] + libs += [ + "AppKit.framework", + "CoreFoundation.framework", + ] } if (pdfium_bundle_freetype) { @@ -183,7 +193,10 @@ static_library("fdrm") { "core/src/fdrm/crypto/fx_crypt_sha.cpp", ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] } static_library("fpdfdoc") { @@ -213,13 +226,14 @@ static_library("fpdfdoc") { "core/src/fpdfdoc/tagged_int.h", ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] } - static_library("fpdfapi") { sources = [ - "core/include/fpdfapi/fpdfapi.h", "core/include/fpdfapi/fpdf_module.h", "core/include/fpdfapi/fpdf_objects.h", "core/include/fpdfapi/fpdf_page.h", @@ -228,12 +242,11 @@ static_library("fpdfapi") { "core/include/fpdfapi/fpdf_render.h", "core/include/fpdfapi/fpdf_resource.h", "core/include/fpdfapi/fpdf_serial.h", + "core/include/fpdfapi/fpdfapi.h", "core/src/fpdfapi/fpdf_basic_module.cpp", - "core/src/fpdfapi/fpdf_cmaps/cmap_int.h", "core/src/fpdfapi/fpdf_cmaps/CNS1/Adobe-CNS1-UCS2_5.cpp", "core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp", "core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp", - "core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.cpp", "core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp", "core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp", "core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp", @@ -245,9 +258,8 @@ static_library("fpdfapi") { "core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-H_3.cpp", "core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-V_3.cpp", "core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp", - "core/src/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp", + "core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.cpp", "core/src/fpdfapi/fpdf_cmaps/GB1/Adobe-GB1-UCS2_5.cpp", - "core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.cpp", "core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp", "core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp", "core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp", @@ -260,6 +272,7 @@ static_library("fpdfapi") { "core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp", "core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp", "core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-V_4.cpp", + "core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.cpp", "core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp", "core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp", "core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-V_2.cpp", @@ -269,7 +282,6 @@ static_library("fpdfapi") { "core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp", "core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp", "core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp", - "core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.cpp", "core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp", "core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-V_1.cpp", "core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-H_2.cpp", @@ -280,8 +292,8 @@ static_library("fpdfapi") { "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp", "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp", "core/src/fpdfapi/fpdf_cmaps/Japan1/V_1.cpp", + "core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.cpp", "core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp", - "core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp", "core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp", "core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp", "core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp", @@ -292,6 +304,9 @@ static_library("fpdfapi") { "core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp", "core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-V_1.cpp", "core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp", + "core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp", + "core/src/fpdfapi/fpdf_cmaps/cmap_int.h", + "core/src/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp", "core/src/fpdfapi/fpdf_edit/editint.h", "core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp", "core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp", @@ -333,7 +348,10 @@ static_library("fpdfapi") { "core/src/fpdfapi/fpdf_render/render_int.h", ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] } static_library("fpdftext") { @@ -349,7 +367,10 @@ static_library("fpdftext") { "core/src/fpdftext/unicodenormalizationdata.h", ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] } static_library("fxcodec") { @@ -431,7 +452,19 @@ static_library("fxcodec") { # conversion to check that an address is 16-bit aligned (benign). cflags_c = [ "-Wno-pointer-to-int-cast" ] } - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] +} + +config("fxge_warnings") { + if (is_clang) { + cflags = [ + # http://code.google.com/p/pdfium/issues/detail?id=188 + "-Wno-switch", + ] + } } static_library("fxcrt") { @@ -448,12 +481,6 @@ static_library("fxcrt") { "core/include/fxcrt/fx_ucd.h", "core/include/fxcrt/fx_xml.h", "core/src/fxcrt/extension.h", - "core/src/fxcrt/fxcrt_platforms.cpp", - "core/src/fxcrt/fxcrt_platforms.h", - "core/src/fxcrt/fxcrt_posix.cpp", - "core/src/fxcrt/fxcrt_posix.h", - "core/src/fxcrt/fxcrt_windows.cpp", - "core/src/fxcrt/fxcrt_windows.h", "core/src/fxcrt/fx_arabic.cpp", "core/src/fxcrt/fx_arabic.h", "core/src/fxcrt/fx_basic_array.cpp", @@ -473,11 +500,20 @@ static_library("fxcrt") { "core/src/fxcrt/fx_unicode.cpp", "core/src/fxcrt/fx_xml_composer.cpp", "core/src/fxcrt/fx_xml_parser.cpp", + "core/src/fxcrt/fxcrt_platforms.cpp", + "core/src/fxcrt/fxcrt_platforms.h", + "core/src/fxcrt/fxcrt_posix.cpp", + "core/src/fxcrt/fxcrt_posix.h", + "core/src/fxcrt/fxcrt_windows.cpp", + "core/src/fxcrt/fxcrt_windows.h", "core/src/fxcrt/plex.h", "core/src/fxcrt/xml_int.h", ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] } static_library("fxge") { @@ -544,7 +580,11 @@ static_library("fxge") { ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":fxge_warnings", + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] if (pdf_use_skia) { sources = [ @@ -594,7 +634,10 @@ static_library("fxedit") { "fpdfsdk/src/fxedit/fxet_pageobjs.cpp", ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] } static_library("pdfwindow") { @@ -637,7 +680,10 @@ static_library("pdfwindow") { "fpdfsdk/src/pdfwindow/PWL_Wnd.cpp", ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] } static_library("javascript") { @@ -728,7 +774,10 @@ static_library("formfiller") { "fpdfsdk/src/formfiller/FFL_TextField.cpp", ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] } static_library("fpdfxfa") { @@ -1443,7 +1492,10 @@ test("pdfium_unittests") { ] include_dirs = [ "." ] configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] } test("pdfium_embeddertests") { @@ -1485,5 +1537,8 @@ test("pdfium_embeddertests") { ] } configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] + configs += [ + ":pdfium_config", + "//build/config/compiler:no_chromium_code", + ] } diff --git a/README b/README deleted file mode 100644 index 3a2cbde22f..0000000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -For build instructions visit https://code.google.com/p/pdfium/wiki/Build \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000..67d84485ff --- /dev/null +++ b/README.md @@ -0,0 +1,134 @@ +# PDFium + +## Prerequisites + +Get the chromium depot tools via the instructions at +http://www.chromium.org/developers/how-tos/install-depot-tools (this provides +the gclient utilty needed below). + +Also install Python, Subversion, and Git and make sure they're in your path. + +## Get the code + +The name of the top-level directory does not matter. In our examples, we use +"repo". This directory must not have been used before by `gclient config` as +each directory can only house a single gclient configuration. + +``` +mkdir repo +cd repo +gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git +gclient sync +cd pdfium +``` + +## Generate the build files + +We use the GYP library to generate the build files. + +At this point, you have two options. The first option is to use the [Ninja] +(http://martine.github.io/ninja/) build system (also included with the +depot\_tools checkout). This is the default as of mid-September, 2015. +Previously, the second option (platform-specific build files) was the default. +Most PDFium developers use Ninja, as does our [continuous build system] +(http://build.chromium.org/p/client.pdfium/). + + * On Windows: `build\gyp_pdfium` + * For all other platforms: `build/gyp_pdfium` + +The second option is to generate platform-specific build files, i.e. Makefiles +on Linux, sln files on Windows, and xcodeproj files on Mac. To do so, set the +GYP\_GENERATORS environment variable appropriately (e.g. "make", "msvs", or +"xcode") before running the above command. + +## Building the code + +If you used Ninja, you can build the sample program by: `ninja -C out/Debug +pdfium_test` You can build the entire product (which includes a few unit +tests) by: `ninja -C out/Debug`. + +If you're not using Ninja, then building is platform-specific. + + * On Linux: `make pdfium_test` + * On Mac: `open build/all.xcodeproj` + * On Windows: open build\all.sln + +## Running the sample program + +The pdfium\_test program supports reading, parsing, and rasterizing the pages of +a .pdf file to .ppm or .png output image files (windows supports two other +formats). For example: `out/Debug/pdfium_test --ppm path/to/myfile.pdf`. Note +that this will write output images to `path/to/myfile.pdf..ppm`. + +## Testing + +There are currently several test suites that can be run: + + * pdfium\_unittests + * pdfium\_embeddertests + * testing/tools/run\_corpus\_tests.py + * testing/tools/run\_javascript\_tests.py + * testing/tools/run\_pixel\_tests.py + +It is possible the tests in the `testing` directory can fail due to font +differences on the various platforms. These tests are reliable on the bots. If +you see failures, it can be a good idea to run the tests on the tip-of-tree +checkout to see if the same failures appear. + +## Waterfall + +The current health of the source tree can be found at +http://build.chromium.org/p/client.pdfium/console + +## Community + +There are several mailing lists that are setup: + + * [PDFium](https://groups.google.com/forum/#!forum/pdfium) + * [PDFium Reviews](https://groups.google.com/forum/#!forum/pdfium-reviews) + * [PDFium Bugs](https://groups.google.com/forum/#!forum/pdfium-bugs) + +Note, the Reviews and Bugs lists are typically read-only. + +## Bugs + + We will be using this +[bug tracker](https://code.google.com/p/pdfium/issues/list), but for security +bugs, please use [Chromium's security bug template] +(https://code.google.com/p/chromium/issues/entry?template=Security%20Bug) +and add the "Cr-Internals-Plugins-PDF" label. + +## Contributing code + +For contributing code, we will follow +[Chromium's process](http://dev.chromium.org/developers/contributing-code) +as much as possible. The main exceptions are: + +1. Code has to conform to the existing style and not Chromium/Google style. +2. There is no commit queue, approved committers can land their changes via +`git cl land` +3. Changes must be merged to the XFA branch as well (see below). + +## Branches + +There is a branch for a forthcoming feature called XFA that you can get by +following the steps above, then: + +``` +git checkout origin/xfa +build/gyp_pdfium +ninja -C out/Debug +``` + +Merging to XFA requires: + +``` +git checkout origin/xfa +git checkout -b merge_branch +git branch --set-upstream-to=origin/xfa +git cherry-pick -x +git commit --amend # add Merge to XFA +git cl upload +``` + +Then wait for approval, and `git cl land` diff --git a/docs/build.md b/docs/build.md deleted file mode 100644 index a32f9fbc4b..0000000000 --- a/docs/build.md +++ /dev/null @@ -1,134 +0,0 @@ -# PDFium - -## Prerequisites - -Get the chromium depot tools via the instructions at -http://www.chromium.org/developers/how-tos/install-depot-tools (this provides -the gclient utilty needed below). - -Also install Python, Subversion, and Git and make sure they're in your path. - -## Get the code - -The name of the top-level directory does not matter. In our examples, we use -"repo". This directory must not have been used before by `gclient config` as -each directory can only house a single gclient configuration. - -``` -mkdir repo -cd repo -gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git -gclient sync -cd pdfium -``` - -## Generate the build files - -We use the GYP library to generate the build files. - -At this point, you have two options. The first option is to use the [Ninja] -(http://martine.github.io/ninja/) build system (also included with the -depot\_tools checkout). This is the default as of mid-September, 2015. -Previously, the second option (platform-specific build files) was the default. -Most PDFium developers use Ninja, as does our [continuous build system] -(http://build.chromium.org/p/client.pdfium/). - - * On Windows: `build\gyp\_pdfium` - * For all other platforms: `build/gyp\_pdfium` - -The second option is to generate platform-specific build files, i.e. Makefiles -on Linux, sln files on Windows, and xcodeproj files on Mac. To do so, set the -GYP\_GENERATORS environment variable appropriately (e.g. "make", "msvs", or -"xcode") before running the above command. - -## Building the code - -If you used Ninja, you can build the sample program by: `ninja -C out/Debug -pdfium\_test` You can build the entire product (which includes a few unit -tests) by: `ninja -C out/Debug`. - -If you're not using Ninja, then building is platform-specific. - - * On Linux: `make pdfium\_test` - * On Mac: `open build/all.xcodeproj` - * On Windows: open build\all.sln - -## Running the sample program - -The pdfium\_test program supports reading, parsing, and rasterizing the pages of -a .pdf file to .ppm or .png output image files (windows supports two other -formats). For example: `out/Debug/pdfium\_test --ppm path/to/myfile.pdf`. Note -that this will write output images to `path/to/myfile.pdf..ppm`. - -## Testing - -There are currently several test suites that can be run: - - * pdfium\_unittests - * pdfium\_embeddertests - * testing/tools/run\_corpus\_tests.py - * testing/tools/run\_javascript\_tests.py - * testing/tools/run\_pixel\_tests.py - -It is possible the tests in the `testing` directory can fail due to font -differences on the various platforms. These tests are reliable on the bots. If -you see failures, it can be a good idea to run the tests on the tip-of-tree -checkout to see if the same failures appear. - -## Waterfall - -The current health of the source tree can be found at -http://build.chromium.org/p/client.pdfium/console - -## Community - -There are several mailing lists that are setup: - - * [PDFium](https://groups.google.com/forum/#!forum/pdfium) - * [PDFium Reviews](https://groups.google.com/forum/#!forum/pdfium-reviews) - * [PDFium Bugs](https://groups.google.com/forum/#!forum/pdfium-bugs) - -Note, the Reviews and Bugs lists are typically read-only. - -## Bugs - - We will be using this -[bug tracker](https://code.google.com/p/pdfium/issues/list), but for security -bugs, please use [Chromium's security bug template] -(https://code.google.com/p/chromium/issues/entry?template=Security%20Bug) -and add the "Cr-Internals-Plugins-PDF" label. - -## Contributing code - -For contributing code, we will follow -[Chromium's process](http://dev.chromium.org/developers/contributing-code) -as much as possible. The main exceptions are: - -1. Code has to conform to the existing style and not Chromium/Google style. -2. There is no commit queue, approved committers can land their changes via -`git cl land` -3. Changes must be merged to the XFA branch as well (see below). - -## Branches - -There is a branch for a forthcoming feature called XFA that you can get by -following the steps above, then: - -``` -git checkout origin/xfa -build/gyp_pdfium -ninja -C out/Debug -``` - -Merging to XFA requires: - -``` -git checkout origin/xfa -git checkout -b merge_branch -git branch --set-upstream-to=origin/xfa -git cherry-pick -x -git commit --amend # add Merge to XFA -git cl upload -``` - -Then wait for approval, and `git cl land` diff --git a/pdfium.gni b/pdfium.gni index afb1d7b217..7f08c71086 100644 --- a/pdfium.gni +++ b/pdfium.gni @@ -18,4 +18,3 @@ declare_args() { # Build PDFium against skia (experimental) rather than agg. pdf_use_skia = false } - diff --git a/pdfium.gyp b/pdfium.gyp index edb9424505..86e14da6e9 100644 --- a/pdfium.gyp +++ b/pdfium.gyp @@ -534,6 +534,12 @@ 'core/src/fxge/ge/fx_ge_text.cpp', 'core/src/fxge/ge/text_int.h', ], + 'variables': { + 'clang_warning_flags': [ + # http://code.google.com/p/pdfium/issues/detail?id=188 + '-Wno-switch', + ], + }, 'conditions': [ ['pdf_use_skia==1', { 'sources': [ @@ -770,8 +776,8 @@ 'core/src/fxcrt/fx_basic_memmgr_unittest.cpp', 'core/src/fxcrt/fx_basic_wstring_unittest.cpp', 'core/src/fxcrt/fx_system_unittest.cpp', - 'testing/fx_string_testhelpers.cpp', 'testing/fx_string_testhelpers.h', + 'testing/fx_string_testhelpers.cpp', 'third_party/base/nonstd_unique_ptr_unittest.cpp', ], 'conditions': [ -- cgit v1.2.3