• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS.  PLEASE
2//     CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
3//     DEPENDING ON IT IN YOUR PROJECT. ***
4package {
5    default_applicable_licenses: ["external_pdfium_license"],
6}
7
8// Added automatically by a large-scale-change that took the approach of
9// 'apply every license found to every target'. While this makes sure we respect
10// every license restriction, it may not be entirely correct.
11//
12// e.g. GPL in an MIT project might only apply to the contrib/ directory.
13//
14// Please consider splitting the single license below into multiple licenses,
15// taking care not to lose any license_kind information, and overriding the
16// default license using the 'licenses: [...]' property on targets as needed.
17//
18// For unused files, consider creating a 'fileGroup' with "//visibility:private"
19// to attach the license to, and including a comment whether the files may be
20// used in the current project.
21// See: http://go/android-license-faq
22license {
23    name: "external_pdfium_license",
24    visibility: [":__subpackages__"],
25    license_kinds: [
26        "SPDX-license-identifier-Apache-2.0",
27        "SPDX-license-identifier-Artistic",
28        "SPDX-license-identifier-BSD",
29        "SPDX-license-identifier-FTL",
30        "SPDX-license-identifier-MIT",
31        "SPDX-license-identifier-OFL", // by exception only
32        "SPDX-license-identifier-Zlib",
33        "SPDX-license-identifier-libtiff",
34        "legacy_unencumbered",
35    ],
36    license_text: [
37        "LICENSE",
38    ],
39}
40
41cc_defaults {
42    name: "pdfium-common",
43    cflags: [
44        "-O3",
45        "-fstrict-aliasing",
46        "-fprefetch-loop-arrays",
47        "-fexceptions",
48
49        "-Wno-implicit-fallthrough",
50        "-Wno-missing-field-initializers",
51        "-Wno-non-virtual-dtor",
52        "-Wno-unused-parameter",
53
54        // pdfium_common_config
55        "-DOPJ_STATIC",
56        "-DPNG_PREFIX",
57        "-DPNG_USE_READ_MACROS",
58
59        // Do not export functions by default. Export only functions annotated
60        // with FPDF_EXPORT.
61        "-fvisibility=hidden",
62
63        // Macro definitions to enable FPDF_EXPORT.
64        "-DCOMPONENT_BUILD",
65        "-DFPDF_IMPLEMENTATION",
66    ],
67
68    arch: {
69        arm: {
70            instruction_set: "arm",
71        },
72    },
73
74    include_dirs: [
75        "external/freetype/include",
76    ],
77
78    header_libs: [
79        "pdfium-headers",
80        "pdfium-third-party-headers"
81    ],
82}
83
84cc_defaults {
85    name: "pdfium-core",
86
87    defaults: [
88        "pdfium-common"
89    ],
90
91    exclude_srcs: [
92        "**/*_unittest.cpp",
93        "**/*_embeddertest.cpp",
94    ],
95}
96
97
98cc_library_headers {
99    name: "pdfium-headers",
100    export_include_dirs: ["."],
101}
102
103cc_library_headers {
104    name: "pdfium-third-party-headers",
105    export_include_dirs: ["third_party"],
106}
107
108cc_library_shared {
109    name: "libpdfium",
110    defaults: ["pdfium-core"],
111
112    header_libs: [
113        "libpdfium-constants",
114    ],
115
116    whole_static_libs: [
117        "libpdfium-fpdfsdk",
118    ],
119
120    // Transitivity is not supported for static libraries (yet).
121    // Lists the whole transitivity closure here.
122    static_libs: [
123        "libpdfium-agg",
124        "libpdfium-cmaps",
125        "libpdfium-edit",
126        "libpdfium-fdrm",
127        "libpdfium-font",
128        "libpdfium-formfiller",
129        "libpdfium-fpdfdoc",
130        "libpdfium-fpdftext",
131        "libpdfium-fxcodec",
132        "libpdfium-fxcrt",
133        "libpdfium-fxge",
134        "libpdfium-fxjs",
135        "libpdfium-libopenjpeg2",
136        "libpdfium-page",
137        "libpdfium-parser",
138        "libpdfium-pwl",
139        "libpdfium-render",
140        "libpdfium-skia_shared",
141        "libpdfium-third_party-base",
142        "libpdfium-lcms2",
143    ],
144
145    // TODO: figure out why turning on exceptions requires manually linking libdl
146    shared_libs: [
147        "libdl",
148        "libft2",
149        "libicu",
150        "libjpeg",
151        "libz",
152    ],
153
154    ldflags: [
155      "-Wl,-icf=all",
156    ],
157
158    export_include_dirs: ["public"],
159
160}
161
162subdirs = ["third_party"]
163