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 "generateCppAdapter.cpp", 133 "generateCppImpl.cpp", 134 "generateDependencies.cpp", 135 "generateFormattedHidl.cpp", 136 "generateInheritanceHierarchy.cpp", 137 "generateJava.cpp", 138 "generateJavaImpl.cpp", 139 "generateVts.cpp", 140 "hidl-gen_l.ll", 141 "hidl-gen_y.yy", 142 ], 143 shared_libs: [ 144 "libbase", 145 "libjsoncpp", 146 ], 147 static_libs: [ 148 "libcrypto", 149 "libhidl-gen", 150 "libhidl-gen-hash", 151 "libhidl-gen-host-utils", 152 "libhidl-gen-utils", 153 ], 154 export_shared_lib_headers: ["libbase"], 155 export_static_lib_headers: [ 156 "libhidl-gen-hash", 157 "libhidl-gen-utils", 158 ], 159 export_include_dirs: ["."], // for tests 160 yacc: { 161 gen_location_hh: true, 162 gen_position_hh: true, 163 }, 164} 165 166cc_binary_host { 167 name: "hidl-gen", 168 defaults: ["hidl-gen-defaults"], 169 srcs: ["main.cpp"], 170 static_libs: [ 171 "libbase", 172 "libcrypto", 173 "libhidl-gen", 174 "libhidl-gen-ast", 175 "libhidl-gen-hash", 176 "libhidl-gen-host-utils", 177 "libhidl-gen-utils", 178 "libjsoncpp", 179 "liblog", 180 ], 181} 182