xref: /aosp_15_r20/system/libvintf/Android.bp (revision 70a7ec852fcefd15a4fb57f8f183a8b1c3aacb08)
1// Copyright (C) 2017 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
15package {
16    default_applicable_licenses: ["system_libvintf_license"],
17}
18
19// Added automatically by a large-scale-change
20// http://go/android-license-faq
21license {
22    name: "system_libvintf_license",
23    visibility: [":__subpackages__"],
24    license_kinds: [
25        "SPDX-license-identifier-Apache-2.0",
26    ],
27    license_text: [
28        "NOTICE",
29    ],
30}
31
32cc_defaults {
33    name: "libvintf-defaults",
34    cflags: [
35        "-Wall",
36        "-Werror",
37        "-Wextra-semi",
38        "-Wshadow",
39    ],
40
41    target: {
42        android: {
43            cflags: ["-DLIBVINTF_TARGET"],
44        },
45    },
46}
47
48libvintf_private_deps = [
49    "libbase",
50    "liblog",
51    "libselinux",
52    "libtinyxml2",
53    "libz",
54]
55
56cc_defaults {
57    name: "libvintf_static_user_defaults",
58    static_libs: libvintf_private_deps,
59}
60
61cc_library {
62    name: "libvintf",
63    defaults: ["libvintf-defaults"],
64    host_supported: true,
65    recovery_available: true,
66    srcs: [
67        "parse_string.cpp",
68        "parse_xml.cpp",
69        "Apex.cpp",
70        "CompatibilityMatrix.cpp",
71        "FileSystem.cpp",
72        "FQName.cpp",
73        "FqInstance.cpp",
74        "HalManifest.cpp",
75        "HalInterface.cpp",
76        "KernelConfigTypedValue.cpp",
77        "KernelInfo.cpp",
78        "RuntimeInfo.cpp",
79        "ManifestHal.cpp",
80        "ManifestInstance.cpp",
81        "MatrixHal.cpp",
82        "MatrixInstance.cpp",
83        "MatrixKernel.cpp",
84        "PropertyFetcher.cpp",
85        "Regex.cpp",
86        "SystemSdk.cpp",
87        "TransportArch.cpp",
88        "VintfObject.cpp",
89        "XmlFile.cpp",
90        "utils.cpp",
91    ],
92    product_variables: {
93        release_aidl_use_unfrozen: {
94            cflags: ["-DAIDL_USE_UNFROZEN"],
95        },
96    },
97    generated_sources: ["apex-info-list-tinyxml"],
98    shared_libs: libvintf_private_deps,
99    header_libs: [
100        "libaidlmetadata_headers",
101        "libhidlmetadata_headers",
102    ],
103    whole_static_libs: [
104        "libkver",
105        "libkernelconfigs",
106    ],
107    export_include_dirs: [
108        "include",
109        ".",
110    ],
111    local_include_dirs: ["include/vintf"],
112
113    export_shared_lib_headers: [
114        "libbase",
115    ],
116    export_header_lib_headers: [
117        "libaidlmetadata_headers",
118        "libhidlmetadata_headers",
119    ],
120    target: {
121        host: {
122            srcs: [
123                "RuntimeInfo-host.cpp",
124                "VintfObjectRecovery.cpp",
125            ],
126        },
127        android: {
128            srcs: [
129                "RuntimeInfo-target.cpp",
130            ],
131        },
132        recovery: {
133            srcs: [
134                "VintfObjectRecovery.cpp",
135            ],
136        },
137    },
138}
139
140cc_library_headers {
141    name: "libvintf_local_headers",
142    host_supported: true,
143    export_include_dirs: ["."],
144    visibility: [
145        "//system/libvintf:__subpackages__",
146    ],
147}
148
149cc_binary {
150    name: "vintf",
151    defaults: ["libvintf-defaults"],
152    shared_libs: [
153        "libbase",
154        "libjsoncpp",
155        "libvintf",
156    ],
157    srcs: [
158        "main.cpp",
159    ],
160}
161
162cc_binary_host {
163    name: "checkvintf",
164    defaults: ["libvintf-defaults"],
165    static_libs: [
166        "libaidlmetadata",
167        "libbase",
168        "libhidlmetadata",
169        "liblog",
170        "libvintf",
171        "libvintf_fcm_exclude",
172        "libutils",
173        "libtinyxml2",
174    ],
175    stl: "libc++_static",
176    srcs: [
177        "check_vintf.cpp",
178        "HostFileSystem.cpp",
179    ],
180    local_include_dirs: ["include-host"],
181    dist: {
182        targets: ["dist_files"],
183    },
184}
185
186cc_library_static {
187    name: "libassemblevintf",
188    host_supported: true,
189    defaults: ["libvintf-defaults"],
190    shared_libs: [
191        "libvintf",
192        "libbase",
193    ],
194    static_libs: [
195        "libaidlmetadata",
196        "libvts_vintf_test_common",
197    ],
198    product_variables: {
199        release_aidl_use_unfrozen: {
200            cflags: ["-DAIDL_USE_UNFROZEN"],
201        },
202    },
203    srcs: [
204        "AssembleVintf.cpp",
205    ],
206    export_include_dirs: ["include-test"],
207}
208
209cc_binary_host {
210    name: "assemble_vintf",
211    defaults: ["libvintf-defaults"],
212    shared_libs: [
213        "libvintf",
214        "libbase",
215    ],
216    static_libs: [
217        "libaidlmetadata",
218        "libassemblevintf",
219        "libvts_vintf_test_common",
220    ],
221    srcs: [
222        "assemble_vintf_main.cpp",
223    ],
224}
225
226cc_defaults {
227    name: "libvintffm-defaults",
228    defaults: ["libvintf-defaults"],
229    host_supported: true,
230    export_include_dirs: [
231        "include-host",
232        "include-test",
233    ],
234    target: {
235        android: {
236            enabled: false,
237        },
238    },
239    static_libs: [
240        "libbase",
241        "liblog",
242        "libtinyxml2",
243        "libutils",
244        "libvintf",
245    ],
246}
247
248cc_library_static {
249    name: "libvintffm",
250    defaults: ["libvintffm-defaults"],
251    srcs: [
252        "HostFileSystem.cpp",
253        "VintfFm.cpp",
254    ],
255}
256
257cc_binary_host {
258    name: "vintffm",
259    defaults: ["libvintffm-defaults"],
260    static_libs: [
261        "libvintffm",
262    ],
263    srcs: [
264        "VintfFmMain.cpp",
265    ],
266}
267
268cc_library_static {
269    name: "libkernelconfigs",
270    defaults: ["libvintf-defaults"],
271    host_supported: true,
272    recovery_available: true,
273    srcs: [
274        "KernelConfigs.cpp",
275        "KernelConfigParser.cpp",
276    ],
277    header_libs: [
278        "libutils_headers",
279    ],
280    shared_libs: [
281        "libbase",
282        "libz",
283    ],
284    export_include_dirs: [
285        "include",
286    ],
287    local_include_dirs: [
288        "include/vintf",
289    ],
290}
291