1// Copyright (C) 2016 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_tools_hidl_license"], 17} 18 19// Added automatically by a large-scale-change 20// See: http://go/android-license-faq 21license { 22 name: "system_tools_hidl_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: "hidl-gen-defaults", 34 cflags: [ 35 "-Wall", 36 "-Werror", 37 ], 38 target: { 39 host: { 40 cflags: [ 41 "-O0", 42 "-g", 43 ], 44 }, 45 }, 46} 47 48// This configuration is inherited by all hidl-gen-generated modules. 49cc_defaults { 50 name: "hidl-module-defaults", 51 cflags: [ 52 "-Wall", 53 "-Werror", 54 "-Wextra-semi", 55 ], 56 tidy_checks: [ 57 // _hidl_cb and addOnewayTask are stuck because of the legacy ABI 58 "-performance-unnecessary-value-param", 59 ], 60 product_variables: { 61 debuggable: { 62 cflags: ["-D__ANDROID_DEBUGGABLE__"], 63 }, 64 }, 65} 66 67// This configuration is inherited by all hidl-gen-java modules 68java_defaults { 69 name: "hidl-java-module-defaults", 70 // TODO(b/68433855): allow HIDL java to build in the PDK 71 product_variables: { 72 pdk: { 73 enabled: false, 74 }, 75 }, 76} 77 78cc_library_host_static { 79 name: "libhidl-gen", 80 defaults: ["hidl-gen-defaults"], 81 srcs: [ 82 "Annotation.cpp", 83 "ArrayType.cpp", 84 "CompoundType.cpp", 85 "ConstantExpression.cpp", 86 "DeathRecipientType.cpp", 87 "DocComment.cpp", 88 "EnumType.cpp", 89 "FmqType.cpp", 90 "HandleType.cpp", 91 "HidlTypeAssertion.cpp", 92 "Interface.cpp", 93 "Location.cpp", 94 "MemoryType.cpp", 95 "Method.cpp", 96 "NamedType.cpp", 97 "PointerType.cpp", 98 "ScalarType.cpp", 99 "Scope.cpp", 100 "StringType.cpp", 101 "Type.cpp", 102 "TypeDef.cpp", 103 "VectorType.cpp", 104 ], 105 header_libs: ["libhwbinder_headers"], // for constants 106 shared_libs: [ 107 "libbase", 108 "liblog", 109 ], 110 static_libs: [ 111 "libcrypto", 112 "libhidl-gen-hash", 113 "libhidl-gen-host-utils", 114 "libhidl-gen-utils", 115 ], 116 export_shared_lib_headers: ["libbase"], 117 export_static_lib_headers: [ 118 "libhidl-gen-hash", 119 "libhidl-gen-host-utils", 120 "libhidl-gen-utils", 121 ], 122 export_include_dirs: ["."], // for tests 123} 124 125cc_library_host_static { 126 name: "libhidl-gen-ast", 127 defaults: ["hidl-gen-defaults"], 128 srcs: [ 129 "AST.cpp", 130 "Coordinator.cpp", 131 "generateCpp.cpp", 132 "generateCppImpl.cpp", 133 "generateDependencies.cpp", 134 "generateFormattedHidl.cpp", 135 "generateInheritanceHierarchy.cpp", 136 "generateJava.cpp", 137 "generateJavaImpl.cpp", 138 "generateVts.cpp", 139 "hidl-gen_l.ll", 140 "hidl-gen_y.yy", 141 ], 142 shared_libs: [ 143 "libbase", 144 "libjsoncpp", 145 ], 146 static_libs: [ 147 "libcrypto", 148 "libhidl-gen", 149 "libhidl-gen-hash", 150 "libhidl-gen-host-utils", 151 "libhidl-gen-utils", 152 ], 153 export_shared_lib_headers: ["libbase"], 154 export_static_lib_headers: [ 155 "libhidl-gen-hash", 156 "libhidl-gen-utils", 157 ], 158 export_include_dirs: ["."], // for tests 159 yacc: { 160 gen_location_hh: true, 161 gen_position_hh: true, 162 }, 163} 164 165cc_binary_host { 166 name: "hidl-gen", 167 defaults: ["hidl-gen-defaults"], 168 srcs: ["main.cpp"], 169 static_libs: [ 170 "libbase", 171 "libcrypto", 172 "libhidl-gen", 173 "libhidl-gen-ast", 174 "libhidl-gen-hash", 175 "libhidl-gen-host-utils", 176 "libhidl-gen-utils", 177 "libjsoncpp", 178 "liblog", 179 ], 180} 181