Bob Badour | 293a4ae | 2021-02-12 15:54:14 -0800 | [diff] [blame] | 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. *** |
| 4 | package { |
| 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 |
| 22 | license { |
| 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 Cross | d097d3e | 2017-04-19 20:32:09 -0700 | [diff] [blame] | 41 | cc_defaults { |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 42 | name: "pdfium-common", |
Colin Cross | d097d3e | 2017-04-19 20:32:09 -0700 | [diff] [blame] | 43 | cflags: [ |
| 44 | "-O3", |
| 45 | "-fstrict-aliasing", |
| 46 | "-fprefetch-loop-arrays", |
| 47 | "-fexceptions", |
| 48 | |
Chih-Hung Hsieh | e36fd54 | 2018-09-04 14:35:22 -0700 | [diff] [blame] | 49 | "-Wno-implicit-fallthrough", |
Haibo Huang | a14b832 | 2020-04-27 18:22:36 -0700 | [diff] [blame] | 50 | "-Wno-missing-field-initializers", |
| 51 | "-Wno-non-virtual-dtor", |
| 52 | "-Wno-unused-parameter", |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 53 | |
Haibo Huang | a14b832 | 2020-04-27 18:22:36 -0700 | [diff] [blame] | 54 | // pdfium_common_config |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 55 | "-DOPJ_STATIC", |
| 56 | "-DPNG_PREFIX", |
| 57 | "-DPNG_USE_READ_MACROS", |
Ryo Hashimoto | 6b06a8e | 2021-03-12 18:58:55 +0900 | [diff] [blame] | 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", |
Colin Cross | d097d3e | 2017-04-19 20:32:09 -0700 | [diff] [blame] | 66 | ], |
| 67 | |
| 68 | arch: { |
| 69 | arm: { |
| 70 | instruction_set: "arm", |
| 71 | }, |
| 72 | }, |
| 73 | |
Haibo Huang | a14b832 | 2020-04-27 18:22:36 -0700 | [diff] [blame] | 74 | include_dirs: [ |
| 75 | "external/freetype/include", |
| 76 | ], |
| 77 | |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 78 | header_libs: [ |
| 79 | "pdfium-headers", |
| 80 | "pdfium-third-party-headers" |
| 81 | ], |
Colin Cross | d097d3e | 2017-04-19 20:32:09 -0700 | [diff] [blame] | 82 | } |
| 83 | |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 84 | cc_defaults { |
| 85 | name: "pdfium-core", |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 86 | |
| 87 | defaults: [ |
| 88 | "pdfium-common" |
Haibo Huang | a14b832 | 2020-04-27 18:22:36 -0700 | [diff] [blame] | 89 | ], |
| 90 | |
| 91 | exclude_srcs: [ |
| 92 | "**/*_unittest.cpp", |
| 93 | "**/*_embeddertest.cpp", |
| 94 | ], |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | |
Colin Cross | d097d3e | 2017-04-19 20:32:09 -0700 | [diff] [blame] | 98 | cc_library_headers { |
| 99 | name: "pdfium-headers", |
| 100 | export_include_dirs: ["."], |
| 101 | } |
| 102 | |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 103 | cc_library_headers { |
| 104 | name: "pdfium-third-party-headers", |
| 105 | export_include_dirs: ["third_party"], |
| 106 | } |
| 107 | |
Haibo Huang | a14b832 | 2020-04-27 18:22:36 -0700 | [diff] [blame] | 108 | cc_library_shared { |
| 109 | name: "libpdfium", |
| 110 | defaults: ["pdfium-core"], |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 111 | |
Haibo Huang | a14b832 | 2020-04-27 18:22:36 -0700 | [diff] [blame] | 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: [ |
Haibo Huang | a14b832 | 2020-04-27 18:22:36 -0700 | [diff] [blame] | 147 | "libdl", |
| 148 | "libft2", |
Victor Chang | a907511 | 2020-10-09 14:41:17 +0100 | [diff] [blame] | 149 | "libicu", |
Haibo Huang | a14b832 | 2020-04-27 18:22:36 -0700 | [diff] [blame] | 150 | "libjpeg", |
| 151 | "libz", |
| 152 | ], |
| 153 | |
Ryo Hashimoto | 6b06a8e | 2021-03-12 18:58:55 +0900 | [diff] [blame] | 154 | ldflags: [ |
| 155 | "-Wl,-icf=all", |
| 156 | ], |
| 157 | |
Haibo Huang | a14b832 | 2020-04-27 18:22:36 -0700 | [diff] [blame] | 158 | export_include_dirs: ["public"], |
| 159 | |
| 160 | } |
Colin Cross | d097d3e | 2017-04-19 20:32:09 -0700 | [diff] [blame] | 161 | |
| 162 | subdirs = ["third_party"] |