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