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