blob: 85f449bf8d04db9de5bb5701336506552d5d566e [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 whole_static_libs: [
113 "libpdfium-fpdfsdk",
114 ],
115
116 // Transitivity is not supported for static libraries (yet).
117 // Lists the whole transitivity closure here.
118 static_libs: [
119 "libpdfium-agg",
120 "libpdfium-cmaps",
kumarashishgab028b42023-06-23 13:21:22 +0000121 "libpdfium-constants",
Haibo Huanga14b8322020-04-27 18:22:36 -0700122 "libpdfium-edit",
123 "libpdfium-fdrm",
124 "libpdfium-font",
125 "libpdfium-formfiller",
126 "libpdfium-fpdfdoc",
127 "libpdfium-fpdftext",
128 "libpdfium-fxcodec",
129 "libpdfium-fxcrt",
130 "libpdfium-fxge",
131 "libpdfium-fxjs",
132 "libpdfium-libopenjpeg2",
133 "libpdfium-page",
134 "libpdfium-parser",
135 "libpdfium-pwl",
136 "libpdfium-render",
137 "libpdfium-skia_shared",
138 "libpdfium-third_party-base",
139 "libpdfium-lcms2",
140 ],
141
142 // TODO: figure out why turning on exceptions requires manually linking libdl
143 shared_libs: [
Haibo Huanga14b8322020-04-27 18:22:36 -0700144 "libdl",
145 "libft2",
Victor Changa9075112020-10-09 14:41:17 +0100146 "libicu",
Haibo Huanga14b8322020-04-27 18:22:36 -0700147 "libjpeg",
148 "libz",
149 ],
150
Ryo Hashimoto6b06a8e2021-03-12 18:58:55 +0900151 ldflags: [
152 "-Wl,-icf=all",
153 ],
154
Haibo Huanga14b8322020-04-27 18:22:36 -0700155 export_include_dirs: ["public"],
156
157}
Colin Crossd097d3e2017-04-19 20:32:09 -0700158
159subdirs = ["third_party"]