xref: /aosp_15_r20/external/jsoncpp/Android.bp (revision 4484440890e2bc6e07362b4feaf15601abfe0071)
1package {
2    default_applicable_licenses: ["external_jsoncpp_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20    name: "external_jsoncpp_license",
21    visibility: [":__subpackages__"],
22    license_kinds: [
23        "SPDX-license-identifier-MIT",
24        "legacy_unencumbered",
25    ],
26    license_text: [
27        "LICENSE",
28    ],
29}
30
31cc_defaults {
32    name: "libjsoncpp_defaults",
33
34    srcs: [
35        "src/lib_json/json_reader.cpp",
36        "src/lib_json/json_value.cpp",
37        "src/lib_json/json_writer.cpp",
38    ],
39
40    local_include_dirs: [
41        "src/lib_json",
42    ],
43
44    include_build_directory: false,
45
46    export_include_dirs: ["include"],
47
48    cflags: [
49        "-DJSON_USE_EXCEPTION=0",
50        "-DJSONCPP_NO_LOCALE_SUPPORT",
51        "-Wall",
52        "-Werror",
53        "-Wno-implicit-fallthrough",
54        // src/lib_json/json_reader.cpp:210  has -Wno-implicit-fallthrough
55    ],
56
57    target: {
58        darwin: {
59            enabled: true,
60        },
61        windows: {
62            enabled: true,
63        },
64    },
65}
66
67cc_library {
68    name: "libjsoncpp",
69    defaults: ["libjsoncpp_defaults"],
70    vendor_available: true,
71    product_available: true,
72    double_loadable: true,
73    host_supported: true,
74    ramdisk_available: true,
75    vendor_ramdisk_available: true,
76    recovery_available: true,
77    apex_available: [
78        "//apex_available:platform",
79        "//apex_available:anyapex",
80    ],
81    native_bridge_supported: true,
82    min_sdk_version: "29",
83}
84
85cc_library_static {
86    name: "libjsoncpp_ndk",
87    defaults: ["libjsoncpp_defaults"],
88    sdk_version: "9",
89    stl: "libc++_static",
90}
91
92cc_library_headers {
93    name: "libjsoncpp_headers",
94    export_include_dirs: ["include"],
95    host_supported: true,
96}
97