• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2015 The PDFium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/rust.gni")
6import("//build_overrides/pdfium.gni")
7
8# This file contains PDFium-related build flags.
9
10declare_args() {
11  # Build PDFium either:
12  # 1) When set to true, with a bundled FreeType, built from FreeType source
13  #    code in //third_party/freetype and PDFium's FreeType configs in
14  #    third_party/freetype/include.
15  # 2) When set to false, use whatever FreeType target is defined in
16  #    //build/config/freetype.
17  pdf_bundle_freetype = pdf_bundle_freetype_override
18
19  # Generate logging messages for click events that reach PDFium
20  pdf_enable_click_logging = false
21
22  # Build PDFium either with or without v8 support.
23  pdf_enable_v8 = pdf_enable_v8_override
24
25  # Build PDFium either with or without XFA Forms support.
26  pdf_enable_xfa = pdf_enable_xfa_override
27
28  # If XFA, also support bmp codec. Ignored if not XFA.
29  pdf_enable_xfa_bmp = true
30
31  # If XFA, also support gif codec. Ignored if not XFA.
32  pdf_enable_xfa_gif = true
33
34  # If XFA, also support png codec. Ignored if not XFA.
35  pdf_enable_xfa_png = true
36
37  # If XFA, also support tiff codec. Ignored if not XFA.
38  pdf_enable_xfa_tiff = true
39
40  # Build PDFium against PartitionAlloc. When false, PDFium must build without
41  # requiring any PartitionAlloc headers or code to be present. When true,
42  # PDFium will use PartitionAlloc partitions to separate strings, scalars,
43  # etc. from other allocations. However, the use of PartitionAlloc for new or
44  # malloc is controlled by args in build_overrides/partition_alloc.gni.
45  pdf_use_partition_alloc = pdf_use_partition_alloc_override
46
47  # Build PDFium to use Skia (experimental) for all PDFium graphics.
48  # If enabled, coexists in build with AGG graphics and the default
49  # renderer is selectable at runtime.
50  pdf_use_skia = pdf_use_skia_override
51
52  # Build PDFium with experimental Fontations library support.
53  # If enabled, coexists in build with FreeType library and the default font
54  # library is selectable at runtime.
55  # Note that Fontations requires Skia and Rust support.
56  pdf_enable_fontations = pdf_enable_fontations_override
57
58  # Build PDFium standalone. Now only controls whether the test binaries
59  # are built. Most logic is conditioned by build_with_chromium.
60  pdf_is_standalone = false
61
62  # Build a complete static library
63  pdf_is_complete_lib = false
64
65  # Enable callgrind for performance profiling
66  enable_callgrind = false
67
68  # Don't build against bundled lcms2.
69  use_system_lcms2 = false
70
71  # Don't build against bundled libopenjpeg2.
72  use_system_libopenjpeg2 = false
73
74  # Don't build against bundled libpng.
75  use_system_libpng = false
76
77  # Don't build against bundled libtiff.
78  use_system_libtiff = false
79
80  # Don't build against bundled zlib.
81  use_system_zlib = false
82
83  # Enable SSE2 for MSVC builds. Ignored if it's not a MSVC build.
84  msvc_use_sse2 = true
85}
86
87assert(!pdf_is_complete_lib || !is_component_build,
88       "pdf_is_complete_lib=true requires is_component_build=false")
89
90assert(
91    !pdf_enable_fontations || (enable_rust && enable_rust_cxx && pdf_use_skia),
92    "pdf_enable_fontations=true requires enable_rust=true, enable_rust_cxx=true, and pdf_use_skia=true")
93