xref: /aosp_15_r20/external/tinyxml2/Android.bp (revision 7485b22521f577cf944e5687361548d8993d8d2c)
1package {
2    default_applicable_licenses: ["external_tinyxml2_license"],
3}
4
5license {
6    name: "external_tinyxml2_license",
7    visibility: [":__subpackages__"],
8    license_kinds: [
9        "SPDX-license-identifier-BSD",
10        "SPDX-license-identifier-MIT",
11        "SPDX-license-identifier-Zlib",
12        "legacy_unencumbered",
13    ],
14    license_text: [
15        "LICENSE.txt",
16    ],
17}
18
19// The jquery stuff in docs/ is a bit ambiguous with its use of and/or when talking about the GPL,
20// so let's just make it clear that we don't use any of that stuff anyway...
21license {
22    name: "external_tinyxml2_docs_license",
23    license_kinds: ["SPDX-license-identifier-GPL"],
24    license_text: [
25        "LICENSE.txt",
26    ],
27}
28
29// ...and prevent anyone from trying to do so:
30filegroup {
31    name: "external_tinyxml2_docs",
32    srcs: ["docs/**/*"],
33    visibility: ["//visibility:private"],
34}
35
36cc_library {
37    name: "libtinyxml2",
38    host_supported: true,
39    vendor_available: true,
40    product_available: true,
41    recovery_available: true,
42
43    srcs: ["tinyxml2.cpp"],
44
45    cflags: [
46        "-Wall",
47        "-Werror",
48        "-Wno-implicit-fallthrough",
49        // tinyxml2.cpp line 436, 441, 446 have -Wimplicit-fallthrough.
50    ],
51
52    shared_libs: ["liblog"],
53
54    target: {
55        android: {
56            cflags: [
57                // LOG_TO_ANDROID_LOGCAT
58                "-DDEBUG",
59                "-DANDROID_NDK",
60            ],
61        },
62        windows: {
63            enabled: true,
64            shared: {
65                enabled: false,
66            },
67        },
68    },
69
70    export_include_dirs: ["."],
71
72    min_sdk_version: "S",
73
74    apex_available: [
75        "com.android.art",
76        "com.android.art.debug",
77        "com.android.runtime", // used by linkerconfig
78        "//apex_available:platform", // For odsign.
79    ],
80}
81
82cc_test {
83    name: "tinyxml2-xmltest",
84    srcs: ["xmltest.cpp"],
85    shared_libs: ["libtinyxml2"],
86    data: [
87        "resources/**/*",
88    ],
89}
90
91sh_test {
92    name: "tinyxml2-tests",
93    src: "run-tinyxml2-tests-on-android.sh",
94    filename: "run-tinyxml2-tests-on-android.sh",
95    test_suites: ["general-tests"],
96    host_supported: true,
97    device_supported: false,
98    require_root: true,
99    target_required: ["tinyxml2-xmltest"],
100}
101