xref: /aosp_15_r20/external/nanopb-c/Android.bp (revision c8d645cafcee3f91213d30caa0fe303887010b9b)
1// Copyright (C) 2014 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15//
16
17package {
18    default_applicable_licenses: ["external_nanopb-c_license"],
19}
20
21// Added automatically by a large-scale-change that took the approach of
22// 'apply every license found to every target'. While this makes sure we respect
23// every license restriction, it may not be entirely correct.
24//
25// e.g. GPL in an MIT project might only apply to the contrib/ directory.
26//
27// Please consider splitting the single license below into multiple licenses,
28// taking care not to lose any license_kind information, and overriding the
29// default license using the 'licenses: [...]' property on targets as needed.
30//
31// For unused files, consider creating a 'fileGroup' with "//visibility:private"
32// to attach the license to, and including a comment whether the files may be
33// used in the current project.
34//
35// large-scale-change included anything that looked like it might be a license
36// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
37//
38// Please consider removing redundant or irrelevant files from 'license_text:'.
39// See: http://go/android-license-faq
40license {
41    name: "external_nanopb-c_license",
42    visibility: [":__subpackages__"],
43    license_kinds: [
44        "SPDX-license-identifier-BSD",
45        "SPDX-license-identifier-MIT",
46        "SPDX-license-identifier-Zlib",
47        "legacy_unencumbered",
48    ],
49    license_text: [
50        "LICENSE.txt",
51        "NOTICE",
52    ],
53}
54
55cc_defaults {
56    name: "libprotobuf-c-nano-defaults",
57    cflags: [
58        "-Wall",
59        "-Werror",
60        "-Wno-sign-compare",
61        "-Wno-unused-parameter",
62    ],
63    srcs: [
64        "pb_common.c",
65        "pb_decode.c",
66        "pb_encode.c",
67    ],
68    sdk_version: "19",
69    export_include_dirs: ["."],
70    vendor_available: true,
71    host_supported: true,
72}
73
74cc_library_static {
75    name: "libprotobuf-c-nano",
76    defaults: ["libprotobuf-c-nano-defaults"],
77    apex_available: [
78        "//apex_available:platform",
79        "com.android.btservices",
80    ],
81    min_sdk_version: "30",
82}
83
84cc_library_static {
85    name: "libprotobuf-c-nano-enable_malloc",
86    defaults: ["libprotobuf-c-nano-defaults"],
87
88    cflags: ["-DPB_ENABLE_MALLOC"],
89}
90
91cc_library_static {
92    name: "libprotobuf-c-nano-16bit",
93    defaults: ["libprotobuf-c-nano-defaults"],
94
95    cflags: ["-DPB_FIELD_16BIT"],
96}
97
98cc_library_static {
99    name: "libprotobuf-c-nano-enable_malloc-16bit",
100    defaults: ["libprotobuf-c-nano-defaults"],
101
102    cflags: ["-DPB_ENABLE_MALLOC", "-DPB_FIELD_16BIT"],
103}
104
105cc_library_static {
106    name: "libprotobuf-c-nano-32bit",
107    defaults: ["libprotobuf-c-nano-defaults"],
108
109    cflags: ["-DPB_FIELD_32BIT"],
110}
111
112cc_library_static {
113    name: "libprotobuf-c-nano-enable_malloc-32bit",
114    defaults: ["libprotobuf-c-nano-defaults"],
115
116    cflags: ["-DPB_ENABLE_MALLOC", "-DPB_FIELD_32BIT"],
117}
118
119dirgroup {
120    name: "trusty_dirgroup_external_nanopb-c",
121    dirs: ["."],
122    visibility: ["//trusty/vendor/google/aosp/scripts"],
123}
124