blob: 4af25048f22078661367eab953bfd6745eb0ed89 [file] [log] [blame]
Bob Badour293a4ae2021-02-12 15:54:14 -08001// *** 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
Colin Crossd097d3e2017-04-19 20:32:09 -070041cc_defaults {
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070042 name: "pdfium-common",
Colin Crossd097d3e2017-04-19 20:32:09 -070043 cflags: [
44 "-O3",
45 "-fstrict-aliasing",
46 "-fprefetch-loop-arrays",
47 "-fexceptions",
48
Chih-Hung Hsiehe36fd542018-09-04 14:35:22 -070049 "-Wno-implicit-fallthrough",
Haibo Huanga14b8322020-04-27 18:22:36 -070050 "-Wno-missing-field-initializers",
51 "-Wno-non-virtual-dtor",
52 "-Wno-unused-parameter",
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070053
Haibo Huanga14b8322020-04-27 18:22:36 -070054 // pdfium_common_config
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070055 "-DOPJ_STATIC",
56 "-DPNG_PREFIX",
57 "-DPNG_USE_READ_MACROS",
Ryo Hashimoto6b06a8e2021-03-12 18:58:55 +090058
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",
Colin Crossd097d3e2017-04-19 20:32:09 -070066 ],
67
68 arch: {
69 arm: {
70 instruction_set: "arm",
71 },
72 },
73
Haibo Huanga14b8322020-04-27 18:22:36 -070074 include_dirs: [
75 "external/freetype/include",
76 ],
77
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070078 header_libs: [
79 "pdfium-headers",
80 "pdfium-third-party-headers"
81 ],
Colin Crossd097d3e2017-04-19 20:32:09 -070082}
83
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070084cc_defaults {
85 name: "pdfium-core",
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070086
87 defaults: [
88 "pdfium-common"
Haibo Huanga14b8322020-04-27 18:22:36 -070089 ],
90
91 exclude_srcs: [
92 "**/*_unittest.cpp",
93 "**/*_embeddertest.cpp",
94 ],
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070095}
96
97
Colin Crossd097d3e2017-04-19 20:32:09 -070098cc_library_headers {
99 name: "pdfium-headers",
100 export_include_dirs: ["."],
101}
102
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -0700103cc_library_headers {
104 name: "pdfium-third-party-headers",
105 export_include_dirs: ["third_party"],
106}
107
Haibo Huanga14b8322020-04-27 18:22:36 -0700108cc_library_shared {
109 name: "libpdfium",
110 defaults: ["pdfium-core"],
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -0700111
Haibo Huanga14b8322020-04-27 18:22:36 -0700112 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: [
Haibo Huanga14b8322020-04-27 18:22:36 -0700147 "libdl",
148 "libft2",
Victor Changa9075112020-10-09 14:41:17 +0100149 "libicu",
Haibo Huanga14b8322020-04-27 18:22:36 -0700150 "libjpeg",
151 "libz",
152 ],
153
Ryo Hashimoto6b06a8e2021-03-12 18:58:55 +0900154 ldflags: [
155 "-Wl,-icf=all",
156 ],
157
Haibo Huanga14b8322020-04-27 18:22:36 -0700158 export_include_dirs: ["public"],
159
160}
Colin Crossd097d3e2017-04-19 20:32:09 -0700161
162subdirs = ["third_party"]