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    ],
39
40    target: {
41        android: {
42            cflags: ["-DLIBVINTF_TARGET"],
43        },
44    }
45}
46
47libvintf_private_deps = [
48    "libbase",
49    "libhidl-gen-utils",
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        "CompatibilityMatrix.cpp",
70        "FileSystem.cpp",
71        "HalManifest.cpp",
72        "HalInterface.cpp",
73        "KernelConfigTypedValue.cpp",
74        "KernelConfigParser.cpp",
75        "KernelInfo.cpp",
76        "RuntimeInfo.cpp",
77        "ManifestHal.cpp",
78        "ManifestInstance.cpp",
79        "MatrixHal.cpp",
80        "MatrixInstance.cpp",
81        "MatrixKernel.cpp",
82        "PropertyFetcher.cpp",
83        "Regex.cpp",
84        "SystemSdk.cpp",
85        "TransportArch.cpp",
86        "VintfObject.cpp",
87        "XmlFile.cpp",
88        "utils.cpp",
89    ],
90    shared_libs: libvintf_private_deps,
91    header_libs: [
92        "libaidlmetadata_headers",
93        "libhidlmetadata_headers",
94    ],
95    whole_static_libs: [
96        "libkver",
97    ],
98    export_include_dirs: ["include", "."],
99    local_include_dirs: ["include/vintf"],
100
101    export_shared_lib_headers: [
102        "libbase",
103        "libhidl-gen-utils",
104    ],
105    export_header_lib_headers: [
106        "libaidlmetadata_headers",
107        "libhidlmetadata_headers",
108    ],
109    target: {
110        host: {
111            srcs: [
112                "RuntimeInfo-host.cpp",
113            ],
114        },
115        android: {
116            srcs: [
117                "RuntimeInfo-target.cpp",
118            ],
119        },
120    }
121}
122
123cc_library_headers {
124    name: "libvintf_local_headers",
125    host_supported: true,
126    export_include_dirs: ["."],
127    visibility: [
128        "//system/libvintf:__subpackages__",
129    ],
130}
131
132cc_binary {
133    name: "vintf",
134    defaults: ["libvintf-defaults"],
135    shared_libs: [
136        "libbase",
137        "libhidl-gen-utils",
138        "libvintf",
139    ],
140    srcs: [
141        "main.cpp"
142    ],
143}
144
145cc_binary_host {
146    name: "checkvintf",
147    defaults: ["libvintf-defaults"],
148    static_libs: [
149        "libaidlmetadata",
150        "libbase",
151        "libhidl-gen-utils",
152        "libhidlmetadata",
153        "liblog",
154        "libvintf",
155        "libvintf_fcm_exclude",
156        "libutils",
157        "libtinyxml2",
158    ],
159    stl: "libc++_static",
160    srcs: [
161        "check_vintf.cpp",
162        "HostFileSystem.cpp",
163    ],
164    local_include_dirs: ["include-host"],
165}
166
167cc_library_static {
168    name: "libassemblevintf",
169    host_supported: true,
170    defaults: ["libvintf-defaults"],
171    shared_libs: [
172        "libvintf",
173        "libbase",
174    ],
175    static_libs: [
176        "libvts_vintf_test_common",
177    ],
178    srcs: [
179        "AssembleVintf.cpp",
180    ],
181    export_include_dirs: ["include-test"],
182}
183
184cc_binary_host {
185    name: "assemble_vintf",
186    defaults: ["libvintf-defaults"],
187    shared_libs: [
188        "libvintf",
189        "libbase",
190    ],
191    static_libs: [
192        "libassemblevintf",
193        "libvts_vintf_test_common",
194    ],
195    srcs: [
196        "assemble_vintf_main.cpp"
197    ],
198}
199
200cc_defaults {
201    name: "libvintffm-defaults",
202    defaults: ["libvintf-defaults"],
203    host_supported: true,
204    export_include_dirs: [
205        "include-host",
206        "include-test",
207    ],
208    target: {
209        android: {
210            enabled: false,
211        },
212    },
213    static_libs: [
214        "libbase",
215        "libhidl-gen-utils",
216        "liblog",
217        "libtinyxml2",
218        "libutils",
219        "libvintf",
220    ],
221}
222
223cc_library_static {
224    name: "libvintffm",
225    defaults: ["libvintffm-defaults"],
226    srcs: [
227        "HostFileSystem.cpp",
228        "VintfFm.cpp",
229    ],
230}
231
232cc_binary_host {
233    name: "vintffm",
234    defaults: ["libvintffm-defaults"],
235    static_libs: [
236        "libvintffm",
237    ],
238    srcs: [
239        "VintfFmMain.cpp",
240    ],
241}
242