You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
4.0 KiB

// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE
// CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
// DEPENDING ON IT IN YOUR PROJECT. ***
package {
default_applicable_licenses: ["external_pdfium_license"],
}
// Added automatically by a large-scale-change that took the approach of
// 'apply every license found to every target'. While this makes sure we respect
// every license restriction, it may not be entirely correct.
//
// e.g. GPL in an MIT project might only apply to the contrib/ directory.
//
// Please consider splitting the single license below into multiple licenses,
// taking care not to lose any license_kind information, and overriding the
// default license using the 'licenses: [...]' property on targets as needed.
//
// For unused files, consider creating a 'fileGroup' with "//visibility:private"
// to attach the license to, and including a comment whether the files may be
// used in the current project.
// See: http://go/android-license-faq
license {
name: "external_pdfium_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
"SPDX-license-identifier-Artistic",
"SPDX-license-identifier-BSD",
"SPDX-license-identifier-FTL",
"SPDX-license-identifier-MIT",
"SPDX-license-identifier-OFL", // by exception only
"SPDX-license-identifier-Zlib",
"SPDX-license-identifier-libtiff",
"legacy_unencumbered",
],
license_text: [
"LICENSE",
],
}
cc_defaults {
name: "pdfium-common",
cflags: [
"-O3",
"-fstrict-aliasing",
"-fprefetch-loop-arrays",
"-fexceptions",
"-Wno-implicit-fallthrough",
"-Wno-missing-field-initializers",
"-Wno-non-virtual-dtor",
"-Wno-unused-parameter",
// pdfium_common_config
"-DOPJ_STATIC",
"-DPNG_PREFIX",
"-DPNG_USE_READ_MACROS",
// Do not export functions by default. Export only functions annotated
// with FPDF_EXPORT.
"-fvisibility=hidden",
// Macro definitions to enable FPDF_EXPORT.
"-DCOMPONENT_BUILD",
"-DFPDF_IMPLEMENTATION",
],
arch: {
arm: {
instruction_set: "arm",
},
},
include_dirs: [
"external/freetype/include",
],
header_libs: [
"pdfium-headers",
"pdfium-third-party-headers"
],
}
cc_defaults {
name: "pdfium-core",
defaults: [
"pdfium-common"
],
exclude_srcs: [
"**/*_unittest.cpp",
"**/*_embeddertest.cpp",
],
}
cc_library_headers {
name: "pdfium-headers",
export_include_dirs: ["."],
}
cc_library_headers {
name: "pdfium-third-party-headers",
export_include_dirs: ["third_party"],
}
cc_library_shared {
name: "libpdfium",
defaults: ["pdfium-core"],
header_libs: [
"libpdfium-constants",
],
whole_static_libs: [
"libpdfium-fpdfsdk",
],
// Transitivity is not supported for static libraries (yet).
// Lists the whole transitivity closure here.
static_libs: [
"libpdfium-agg",
"libpdfium-cmaps",
"libpdfium-edit",
"libpdfium-fdrm",
"libpdfium-font",
"libpdfium-formfiller",
"libpdfium-fpdfdoc",
"libpdfium-fpdftext",
"libpdfium-fxcodec",
"libpdfium-fxcrt",
"libpdfium-fxge",
"libpdfium-fxjs",
"libpdfium-libopenjpeg2",
"libpdfium-page",
"libpdfium-parser",
"libpdfium-pwl",
"libpdfium-render",
"libpdfium-skia_shared",
"libpdfium-third_party-base",
"libpdfium-lcms2",
],
// TODO: figure out why turning on exceptions requires manually linking libdl
shared_libs: [
"libdl",
"libft2",
"libicu",
"libjpeg",
"libz",
],
ldflags: [
"-Wl,-icf=all",
],
export_include_dirs: ["public"],
}
subdirs = ["third_party"]