xref: /aosp_15_r20/external/pdfium/third_party/Android.bp (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "external_pdfium_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Artistic
7    //   SPDX-license-identifier-BSD
8    //   SPDX-license-identifier-FTL
9    //   SPDX-license-identifier-MIT
10    //   SPDX-license-identifier-Zlib
11    //   SPDX-license-identifier-libtiff
12    //   legacy_unencumbered
13    default_applicable_licenses: ["external_pdfium_license"],
14}
15
16cc_defaults {
17    name: "pdfium-third-party",
18    defaults: [
19        "pdfium-common"
20    ],
21    visibility: ["//external/pdfium:__subpackages__"],
22    sdk_version: "current",
23    min_sdk_version: "apex_inherit",
24    apex_available: [
25        "com.android.mediaprovider",
26        "//apex_available:platform"
27    ],
28    stl: "c++_static",
29}
30
31cc_library_static {
32    name: "libpdfium-third_party-base",
33    defaults: ["pdfium-third-party"],
34    visibility: ["//external/pdfium:__subpackages__"],
35
36    arch: {
37        arm: {
38            cflags: [
39                "-DARCH_CPU_32_BITS",
40                "-DARCH_CPU_ARMEL",
41            ],
42        },
43        arm64: {
44            cflags: [
45                "-DARCH_CPU_64_BITS",
46                "-DARCH_CPU_ARM64",
47            ],
48        },
49        riscv64: {
50            cflags: [
51                "-DARCH_CPU_64_BITS",
52                "-DARCH_CPU_RISCV64",
53            ],
54        },
55        x86: {
56            cflags: [
57                "-DARCH_CPU_32_BITS",
58                "-DARCH_CPU_X86",
59            ],
60        },
61        x86_64: {
62            cflags: [
63                "-DARCH_CPU_64_BITS",
64                "-DARCH_CPU_X86_64",
65            ],
66        },
67    },
68
69    srcs: [
70        "base/debug/*.cc",
71        "base/memory/*.cc",
72        "base/allocator/partition_allocator/*.cc",
73    ],
74}
75
76cc_library_static {
77    name: "libpdfium-lcms2",
78    defaults: ["pdfium-third-party"],
79
80    cflags: [
81      // cmslut.cc is sloppy with aggregate initialization. Version 2.7 of this
82      // library doesn't appear to have this problem.
83      "-Wno-missing-braces",
84
85      // FindPrev() in cmsplugin.c is unused.
86      "-Wno-unused-function",
87    ],
88
89    srcs: [
90        "lcms/src/*.c",
91    ],
92}
93
94cc_library_static {
95    name: "libpdfium-libopenjpeg2",
96    defaults: ["pdfium-third-party"],
97    visibility: ["//cts/hostsidetests/securitybulletin/securityPatch/CVE-2016-8332"],
98
99    exclude_srcs: [
100        "libopenjpeg/t1_generate_luts.c",
101    ],
102
103    srcs: [
104        "libopenjpeg/*.c",
105        "libopenjpeg/*.cc",
106    ],
107}
108
109cc_library_static {
110    name: "libpdfium-agg",
111    defaults: ["pdfium-third-party"],
112
113    cflags: [
114        // calc_butt_cap() in agg_vcgen_stroke.cpp is unused.
115        "-Wno-unused-function",
116    ],
117
118    srcs: [
119        "agg23/*.cpp",
120    ]
121}
122
123cc_library_static {
124    name: "libpdfium-skia_shared",
125    defaults: ["pdfium-third-party"],
126
127    srcs: [
128        "skia_shared/*.cpp",
129    ],
130}
131