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
15cc_defaults {
16    name: "libvintf-defaults",
17    cflags: [
18        "-Wall",
19        "-Werror",
20        "-Wextra-semi",
21    ],
22
23    target: {
24        android: {
25            cflags: ["-DLIBVINTF_TARGET"],
26        },
27    }
28}
29
30cc_library {
31    name: "libvintf",
32    defaults: ["libvintf-defaults"],
33    host_supported: true,
34    recovery_available: true,
35    srcs: [
36        "parse_string.cpp",
37        "parse_xml.cpp",
38        "CompatibilityMatrix.cpp",
39        "FileSystem.cpp",
40        "HalManifest.cpp",
41        "HalInterface.cpp",
42        "KernelConfigTypedValue.cpp",
43        "KernelConfigParser.cpp",
44        "KernelInfo.cpp",
45        "RuntimeInfo.cpp",
46        "ManifestHal.cpp",
47        "ManifestInstance.cpp",
48        "MatrixHal.cpp",
49        "MatrixInstance.cpp",
50        "MatrixKernel.cpp",
51        "PropertyFetcher.cpp",
52        "Regex.cpp",
53        "SystemSdk.cpp",
54        "TransportArch.cpp",
55        "VintfObject.cpp",
56        "XmlFile.cpp",
57    ],
58    shared_libs: [
59        "libbase",
60        "libhidl-gen-utils",
61        "liblog",
62        "libselinux",
63        "libtinyxml2",
64        "libz",
65    ],
66    header_libs: [
67        "libhidlmetadata_headers",
68    ],
69    export_include_dirs: ["include", "."],
70    local_include_dirs: ["include/vintf"],
71
72    export_shared_lib_headers: [
73        "libbase",
74        "libhidl-gen-utils",
75    ],
76    export_header_lib_headers: [
77        "libhidlmetadata_headers",
78    ],
79    target: {
80        host: {
81            srcs: [
82                "RuntimeInfo-host.cpp",
83            ],
84        },
85        android: {
86            srcs: [
87                "RuntimeInfo-target.cpp",
88            ],
89        },
90    }
91}
92
93cc_library_headers {
94    name: "libvintf_local_headers",
95    host_supported: true,
96    export_include_dirs: ["."],
97    visibility: [
98        "//system/libvintf:__subpackages__",
99    ],
100}
101
102cc_binary {
103    name: "vintf",
104    defaults: ["libvintf-defaults"],
105    shared_libs: [
106        "libbase",
107        "libhidl-gen-utils",
108        "libvintf",
109    ],
110    srcs: [
111        "main.cpp"
112    ],
113}
114
115cc_binary_host {
116    name: "checkvintf",
117    defaults: ["libvintf-defaults"],
118    static_libs: [
119        "libbase",
120        "libhidl-gen-utils",
121        "libhidlmetadata",
122        "liblog",
123        "libvintf",
124        "libutils",
125        "libtinyxml2",
126    ],
127    stl: "libc++_static",
128    srcs: [
129        "check_vintf.cpp",
130    ],
131}
132
133cc_library_static {
134    name: "libassemblevintf",
135    host_supported: true,
136    defaults: ["libvintf-defaults"],
137    shared_libs: [
138        "libvintf",
139        "libbase",
140    ],
141    srcs: [
142        "AssembleVintf.cpp",
143    ],
144    export_include_dirs: ["include-test"],
145}
146
147cc_binary_host {
148    name: "assemble_vintf",
149    defaults: ["libvintf-defaults"],
150    shared_libs: [
151        "libvintf",
152        "libbase",
153    ],
154    static_libs: [
155        "libassemblevintf",
156    ],
157    srcs: [
158        "assemble_vintf_main.cpp"
159    ],
160}
161
162