• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// We need to build this for both the device (as a shared library)
2// and the host (as a static library for tools to use).
3
4// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS.  PLEASE
5//     CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
6//     DEPENDING ON IT IN YOUR PROJECT. ***
7package {
8    default_applicable_licenses: ["external_expat_license"],
9}
10
11// Added automatically by a large-scale-change that took the approach of
12// 'apply every license found to every target'. While this makes sure we respect
13// every license restriction, it may not be entirely correct.
14//
15// e.g. GPL in an MIT project might only apply to the contrib/ directory.
16//
17// Please consider splitting the single license below into multiple licenses,
18// taking care not to lose any license_kind information, and overriding the
19// default license using the 'licenses: [...]' property on targets as needed.
20//
21// For unused files, consider creating a 'fileGroup' with "//visibility:private"
22// to attach the license to, and including a comment whether the files may be
23// used in the current project.
24// See: http://go/android-license-faq
25license {
26    name: "external_expat_license",
27    visibility: [":__subpackages__"],
28    license_kinds: [
29        "SPDX-license-identifier-CC0-1.0",
30        "SPDX-license-identifier-GFDL", // by exception only
31        "SPDX-license-identifier-MIT",
32        "legacy_notice",
33        "legacy_unencumbered",
34    ],
35    license_text: [
36        "COPYING",
37    ],
38}
39
40cc_library {
41    name: "libexpat",
42    vendor_available: true,
43    product_available: true,
44    vndk: {
45        enabled: true,
46    },
47    double_loadable: true,
48    host_supported: true,
49    unique_host_soname: true,
50    sdk_version: "26",
51
52    srcs: [
53        "expat/lib/xmlparse.c",
54        "expat/lib/xmlrole.c",
55        "expat/lib/xmltok.c",
56    ],
57    cflags: [
58        "-fno-strict-aliasing",
59        "-Wall",
60        "-Werror",
61        "-Wmissing-prototypes",
62        "-Wstrict-prototypes",
63        "-Wno-unused-function",
64        "-Wno-unused-parameter",
65        "-Wno-missing-field-initializers",
66        "-DHAVE_EXPAT_CONFIG_H",
67        "-UWIN32_LEAN_AND_MEAN",
68        // As of 2.4.6, xmlparse.c includes expat_config.h *before* including
69        // any system header file, meaning that __BIONIC__ and __GLIBC__ and so
70        // on aren't set, but our modifications to have one expat_config.h for
71        // all targets rely on those defines.
72        "-include stdio.h",
73    ],
74
75    target: {
76        darwin: {
77            cflags: ["-fno-common"],
78        },
79        windows: {
80            enabled: true,
81        },
82        android: {
83            sanitize: {
84                integer_overflow: true,
85                misc_undefined: ["bounds"],
86            },
87        },
88    },
89
90    stl: "none",
91    local_include_dirs: ["lib"],
92    export_include_dirs: ["lib"],
93
94    sanitize: {
95        blocklist: "libexpat_blocklist.txt",
96    },
97
98    apex_available: [
99        "//apex_available:platform",
100        "com.android.art",
101        "com.android.art.debug",
102    ],
103    min_sdk_version: "apex_inherit",
104}
105