summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build_overrides/pdfium.gni6
-rw-r--r--pdfium.gni8
-rw-r--r--third_party/BUILD.gn189
3 files changed, 105 insertions, 98 deletions
diff --git a/build_overrides/pdfium.gni b/build_overrides/pdfium.gni
index a8ce2cff24..e42888f55f 100644
--- a/build_overrides/pdfium.gni
+++ b/build_overrides/pdfium.gni
@@ -12,9 +12,9 @@ pdf_enable_v8_override = true
# Default: Without XFA support.
pdf_enable_xfa_override = false
-# Build PDFium either using the bundled FreeType, or using a third-party
-# FreeType, configured by the embedder in //build/config/freetype.
-# Default: Use the bundled FreeType.
+# Build PDFium either using a bundled FreeType library, or using the FreeType
+# target defined in //build/config/freetype.
+# Default: Use a bundled FreeType.
pdf_bundle_freetype_override = true
# Build PDFium against skia (experimental) rather than agg, replacing all PDFium
diff --git a/pdfium.gni b/pdfium.gni
index 1829831b08..5fda06f5f0 100644
--- a/pdfium.gni
+++ b/pdfium.gni
@@ -7,8 +7,12 @@ import("//build_overrides/pdfium.gni")
# This file contains PDFium-related build flags.
declare_args() {
- # Build PDFium either using the bundled FreeType, or using a third-party
- # FreeType, configured by the embedder in //build/config/freetype.
+ # Build PDFium either:
+ # 1) When set to true, with a bundled FreeType, built from FreeType source
+ # code in //third_party/freetype and PDFium's FreeType configs in
+ # third_party/freetype/include.
+ # 2) When set to false, use whatever FreeType target is defined in
+ # //build/config/freetype.
pdf_bundle_freetype = pdf_bundle_freetype_override
# Build PDFium either with or without v8 support.
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index 27abf1891b..81f919046f 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -56,9 +56,12 @@ if (pdf_bundle_freetype) {
}
config("freetype_public_includes_config") {
+ # The relative freetype/include path points to PDFium's custom config.
+ # The absolute path points to whatever copy of FreeType is in
+ # //third_party/freetype.
include_dirs = [
"freetype/include",
- "freetype/src/include",
+ "//third_party/freetype/src/include",
]
defines = [
"FT_CONFIG_MODULES_H=<freetype-custom-config/ftmodule.h>",
@@ -82,101 +85,101 @@ if (pdf_bundle_freetype) {
defines = [ "FT2_BUILD_LIBRARY" ]
sources = [
- "freetype/src/include/freetype/config/ftconfig.h",
- "freetype/src/include/freetype/config/ftheader.h",
- "freetype/src/include/freetype/config/ftstdlib.h",
- "freetype/src/include/freetype/freetype.h",
- "freetype/src/include/freetype/ftadvanc.h",
- "freetype/src/include/freetype/ftbitmap.h",
- "freetype/src/include/freetype/ftcffdrv.h",
- "freetype/src/include/freetype/fterrdef.h",
- "freetype/src/include/freetype/fterrors.h",
- "freetype/src/include/freetype/ftglyph.h",
- "freetype/src/include/freetype/ftgzip.h",
- "freetype/src/include/freetype/ftimage.h",
- "freetype/src/include/freetype/ftincrem.h",
- "freetype/src/include/freetype/ftlcdfil.h",
- "freetype/src/include/freetype/ftlist.h",
- "freetype/src/include/freetype/ftmm.h",
- "freetype/src/include/freetype/ftmodapi.h",
- "freetype/src/include/freetype/ftmoderror.h",
- "freetype/src/include/freetype/ftobjs.h",
- "freetype/src/include/freetype/ftotval.h",
- "freetype/src/include/freetype/ftoutln.h",
- "freetype/src/include/freetype/ftrender.h",
- "freetype/src/include/freetype/ftsizes.h",
- "freetype/src/include/freetype/ftsnames.h",
- "freetype/src/include/freetype/ftstream.h",
- "freetype/src/include/freetype/ftsystem.h",
- "freetype/src/include/freetype/fttrigon.h",
- "freetype/src/include/freetype/ftttdrv.h",
- "freetype/src/include/freetype/fttypes.h",
- "freetype/src/include/freetype/internal/autohint.h",
- "freetype/src/include/freetype/internal/ftcalc.h",
- "freetype/src/include/freetype/internal/ftdebug.h",
- "freetype/src/include/freetype/internal/ftdriver.h",
- "freetype/src/include/freetype/internal/ftgloadr.h",
- "freetype/src/include/freetype/internal/fthash.h",
- "freetype/src/include/freetype/internal/ftmemory.h",
- "freetype/src/include/freetype/internal/ftobjs.h",
- "freetype/src/include/freetype/internal/ftpic.h",
- "freetype/src/include/freetype/internal/ftrfork.h",
- "freetype/src/include/freetype/internal/ftserv.h",
- "freetype/src/include/freetype/internal/ftstream.h",
- "freetype/src/include/freetype/internal/ftvalid.h",
- "freetype/src/include/freetype/internal/internal.h",
- "freetype/src/include/freetype/internal/psaux.h",
- "freetype/src/include/freetype/internal/pshints.h",
- "freetype/src/include/freetype/internal/services/svcid.h",
- "freetype/src/include/freetype/internal/services/svfntfmt.h",
- "freetype/src/include/freetype/internal/services/svgldict.h",
- "freetype/src/include/freetype/internal/services/svkern.h",
- "freetype/src/include/freetype/internal/services/svmetric.h",
- "freetype/src/include/freetype/internal/services/svmm.h",
- "freetype/src/include/freetype/internal/services/svpostnm.h",
- "freetype/src/include/freetype/internal/services/svprop.h",
- "freetype/src/include/freetype/internal/services/svpscmap.h",
- "freetype/src/include/freetype/internal/services/svpsinfo.h",
- "freetype/src/include/freetype/internal/services/svsfnt.h",
- "freetype/src/include/freetype/internal/services/svttcmap.h",
- "freetype/src/include/freetype/internal/services/svtteng.h",
- "freetype/src/include/freetype/internal/services/svttglyf.h",
- "freetype/src/include/freetype/internal/sfnt.h",
- "freetype/src/include/freetype/internal/t1types.h",
- "freetype/src/include/freetype/internal/tttypes.h",
- "freetype/src/include/freetype/t1tables.h",
- "freetype/src/include/freetype/ttnameid.h",
- "freetype/src/include/freetype/tttables.h",
- "freetype/src/include/freetype/tttags.h",
- "freetype/src/include/ft2build.h",
- "freetype/src/src/base/ftbase.c",
- "freetype/src/src/base/ftbase.h",
- "freetype/src/src/base/ftbitmap.c",
- "freetype/src/src/base/ftglyph.c",
- "freetype/src/src/base/ftinit.c",
- "freetype/src/src/base/ftlcdfil.c",
- "freetype/src/src/base/ftmm.c",
- "freetype/src/src/base/ftsystem.c",
- "freetype/src/src/cff/cff.c",
- "freetype/src/src/cff/cffobjs.h",
- "freetype/src/src/cff/cfftypes.h",
- "freetype/src/src/cid/type1cid.c",
- "freetype/src/src/psaux/psaux.c",
- "freetype/src/src/pshinter/pshinter.c",
- "freetype/src/src/psnames/psmodule.c",
- "freetype/src/src/raster/raster.c",
- "freetype/src/src/sfnt/sfnt.c",
- "freetype/src/src/smooth/smooth.c",
- "freetype/src/src/truetype/truetype.c",
- "freetype/src/src/type1/type1.c",
+ "//third_party/freetype/src/include/freetype/config/ftconfig.h",
+ "//third_party/freetype/src/include/freetype/config/ftheader.h",
+ "//third_party/freetype/src/include/freetype/config/ftstdlib.h",
+ "//third_party/freetype/src/include/freetype/freetype.h",
+ "//third_party/freetype/src/include/freetype/ftadvanc.h",
+ "//third_party/freetype/src/include/freetype/ftbitmap.h",
+ "//third_party/freetype/src/include/freetype/ftcffdrv.h",
+ "//third_party/freetype/src/include/freetype/fterrdef.h",
+ "//third_party/freetype/src/include/freetype/fterrors.h",
+ "//third_party/freetype/src/include/freetype/ftglyph.h",
+ "//third_party/freetype/src/include/freetype/ftgzip.h",
+ "//third_party/freetype/src/include/freetype/ftimage.h",
+ "//third_party/freetype/src/include/freetype/ftincrem.h",
+ "//third_party/freetype/src/include/freetype/ftlcdfil.h",
+ "//third_party/freetype/src/include/freetype/ftlist.h",
+ "//third_party/freetype/src/include/freetype/ftmm.h",
+ "//third_party/freetype/src/include/freetype/ftmodapi.h",
+ "//third_party/freetype/src/include/freetype/ftmoderror.h",
+ "//third_party/freetype/src/include/freetype/ftobjs.h",
+ "//third_party/freetype/src/include/freetype/ftotval.h",
+ "//third_party/freetype/src/include/freetype/ftoutln.h",
+ "//third_party/freetype/src/include/freetype/ftrender.h",
+ "//third_party/freetype/src/include/freetype/ftsizes.h",
+ "//third_party/freetype/src/include/freetype/ftsnames.h",
+ "//third_party/freetype/src/include/freetype/ftstream.h",
+ "//third_party/freetype/src/include/freetype/ftsystem.h",
+ "//third_party/freetype/src/include/freetype/fttrigon.h",
+ "//third_party/freetype/src/include/freetype/ftttdrv.h",
+ "//third_party/freetype/src/include/freetype/fttypes.h",
+ "//third_party/freetype/src/include/freetype/internal/autohint.h",
+ "//third_party/freetype/src/include/freetype/internal/ftcalc.h",
+ "//third_party/freetype/src/include/freetype/internal/ftdebug.h",
+ "//third_party/freetype/src/include/freetype/internal/ftdriver.h",
+ "//third_party/freetype/src/include/freetype/internal/ftgloadr.h",
+ "//third_party/freetype/src/include/freetype/internal/fthash.h",
+ "//third_party/freetype/src/include/freetype/internal/ftmemory.h",
+ "//third_party/freetype/src/include/freetype/internal/ftobjs.h",
+ "//third_party/freetype/src/include/freetype/internal/ftpic.h",
+ "//third_party/freetype/src/include/freetype/internal/ftrfork.h",
+ "//third_party/freetype/src/include/freetype/internal/ftserv.h",
+ "//third_party/freetype/src/include/freetype/internal/ftstream.h",
+ "//third_party/freetype/src/include/freetype/internal/ftvalid.h",
+ "//third_party/freetype/src/include/freetype/internal/internal.h",
+ "//third_party/freetype/src/include/freetype/internal/psaux.h",
+ "//third_party/freetype/src/include/freetype/internal/pshints.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svcid.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svfntfmt.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svgldict.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svkern.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svmetric.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svmm.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svpostnm.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svprop.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svpscmap.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svpsinfo.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svsfnt.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svttcmap.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svtteng.h",
+ "//third_party/freetype/src/include/freetype/internal/services/svttglyf.h",
+ "//third_party/freetype/src/include/freetype/internal/sfnt.h",
+ "//third_party/freetype/src/include/freetype/internal/t1types.h",
+ "//third_party/freetype/src/include/freetype/internal/tttypes.h",
+ "//third_party/freetype/src/include/freetype/t1tables.h",
+ "//third_party/freetype/src/include/freetype/ttnameid.h",
+ "//third_party/freetype/src/include/freetype/tttables.h",
+ "//third_party/freetype/src/include/freetype/tttags.h",
+ "//third_party/freetype/src/include/ft2build.h",
+ "//third_party/freetype/src/src/base/ftbase.c",
+ "//third_party/freetype/src/src/base/ftbase.h",
+ "//third_party/freetype/src/src/base/ftbitmap.c",
+ "//third_party/freetype/src/src/base/ftglyph.c",
+ "//third_party/freetype/src/src/base/ftinit.c",
+ "//third_party/freetype/src/src/base/ftlcdfil.c",
+ "//third_party/freetype/src/src/base/ftmm.c",
+ "//third_party/freetype/src/src/base/ftsystem.c",
+ "//third_party/freetype/src/src/cff/cff.c",
+ "//third_party/freetype/src/src/cff/cffobjs.h",
+ "//third_party/freetype/src/src/cff/cfftypes.h",
+ "//third_party/freetype/src/src/cid/type1cid.c",
+ "//third_party/freetype/src/src/psaux/psaux.c",
+ "//third_party/freetype/src/src/pshinter/pshinter.c",
+ "//third_party/freetype/src/src/psnames/psmodule.c",
+ "//third_party/freetype/src/src/raster/raster.c",
+ "//third_party/freetype/src/src/sfnt/sfnt.c",
+ "//third_party/freetype/src/src/smooth/smooth.c",
+ "//third_party/freetype/src/src/truetype/truetype.c",
+ "//third_party/freetype/src/src/type1/type1.c",
]
if (pdf_use_skia || pdf_use_skia_paths) {
sources += [
- "freetype/src/include/freetype/ftfntfmt.h",
- "freetype/src/include/freetype/ftsynth.h",
- "freetype/src/src/base/ftfntfmt.c",
- "freetype/src/src/base/ftfstype.c",
- "freetype/src/src/base/fttype1.c",
+ "//third_party/freetype/src/include/freetype/ftfntfmt.h",
+ "//third_party/freetype/src/include/freetype/ftsynth.h",
+ "//third_party/freetype/src/src/base/ftfntfmt.c",
+ "//third_party/freetype/src/src/base/ftfstype.c",
+ "//third_party/freetype/src/src/base/fttype1.c",
]
}
}