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 15cc_defaults { 16 name: "hidl-gen-defaults", 17 cflags: [ 18 "-Wall", 19 "-Werror", 20 ], 21 target: { 22 host: { 23 cflags: ["-O0", "-g"], 24 } 25 } 26} 27 28// This configuration is inherited by all hidl-gen-generated modules. 29cc_defaults { 30 name: "hidl-module-defaults", 31 cflags: [ 32 "-Wall", 33 "-Werror", 34 "-Wextra-semi", 35 ], 36 tidy_checks: [ 37 // _hidl_cb and addOnewayTask are stuck because of the legacy ABI 38 "-performance-unnecessary-value-param", 39 ], 40 product_variables: { 41 debuggable: { 42 cflags: ["-D__ANDROID_DEBUGGABLE__"] 43 }, 44 }, 45} 46 47// This configuration is inherited by all hidl-gen-java modules 48java_defaults { 49 name: "hidl-java-module-defaults", 50 // TODO(b/68433855): allow HIDL java to build in the PDK 51 product_variables: { 52 pdk: { 53 enabled: false, 54 }, 55 }, 56} 57 58cc_library_host_shared { 59 name: "libhidl-gen", 60 defaults: ["hidl-gen-defaults"], 61 srcs: [ 62 "Annotation.cpp", 63 "ArrayType.cpp", 64 "CompoundType.cpp", 65 "ConstantExpression.cpp", 66 "DeathRecipientType.cpp", 67 "DocComment.cpp", 68 "EnumType.cpp", 69 "HandleType.cpp", 70 "HidlTypeAssertion.cpp", 71 "Interface.cpp", 72 "Location.cpp", 73 "MemoryType.cpp", 74 "Method.cpp", 75 "NamedType.cpp", 76 "PointerType.cpp", 77 "FmqType.cpp", 78 "RefType.cpp", 79 "ScalarType.cpp", 80 "Scope.cpp", 81 "StringType.cpp", 82 "Type.cpp", 83 "TypeDef.cpp", 84 "VectorType.cpp", 85 ], 86 shared_libs: [ 87 "libbase", 88 "liblog", 89 "libhidl-gen-hash", 90 "libhidl-gen-host-utils", 91 "libhidl-gen-utils", 92 ], 93 export_shared_lib_headers: [ 94 "libbase", 95 "libhidl-gen-host-utils", 96 "libhidl-gen-utils", 97 ], 98 export_include_dirs: ["."], // for tests 99} 100 101cc_library_host_shared { 102 name: "libhidl-gen-ast", 103 defaults: ["hidl-gen-defaults"], 104 srcs: [ 105 "Coordinator.cpp", 106 "generateCpp.cpp", 107 "generateCppAdapter.cpp", 108 "generateCppImpl.cpp", 109 "generateDependencies.cpp", 110 "generateJava.cpp", 111 "generateVts.cpp", 112 "hidl-gen_y.yy", 113 "hidl-gen_l.ll", 114 "AST.cpp", 115 ], 116 shared_libs: [ 117 "libbase", 118 "liblog", 119 "libhidl-gen", 120 "libhidl-gen-hash", 121 "libhidl-gen-host-utils", 122 "libhidl-gen-utils", 123 ], 124 export_shared_lib_headers: [ 125 "libbase", 126 "libhidl-gen-utils", 127 ], 128 export_include_dirs: ["."], // for tests 129} 130 131cc_binary_host { 132 name: "hidl-gen", 133 defaults: ["hidl-gen-defaults"], 134 srcs: ["main.cpp"], 135 shared_libs: [ 136 "libbase", 137 "liblog", 138 "libhidl-gen", 139 "libhidl-gen-ast", 140 "libhidl-gen-hash", 141 "libhidl-gen-host-utils", 142 "libhidl-gen-utils", 143 ], 144} 145