1 // 2 // Copyright (C) 2016 The Android Open Source Project 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 17 cc_defaults { 18 name: "header-checker-defaults", 19 20 defaults: [ 21 "clang-defaults", 22 ], 23 24 cflags: [ 25 "-Wall", 26 "-Werror", 27 "-std=c++11", 28 "-DGOOGLE_PROTOBUF_NO_RTTI", 29 "-UNDEBUG" 30 ], 31 32 target: { 33 windows: { 34 enabled: false 35 } 36 } 37 } 38 39 cc_defaults { 40 name: "header-checker-lib-defaults", 41 42 static_libs: [ 43 "libclangTooling", 44 "libclangToolingCore", 45 "libclangFrontendTool", 46 "libclangFrontend", 47 "libclangDriver", 48 "libclangSerialization", 49 "libclangCodeGen", 50 "libclangRewriteFrontend", 51 "libclangRewrite", 52 "libclangParse", 53 "libclangSema", 54 "libclangStaticAnalyzerFrontend", 55 "libclangStaticAnalyzerCheckers", 56 "libclangStaticAnalyzerMPIChecker", 57 "libclangStaticAnalyzerCore", 58 "libclangAnalysis", 59 "libclangEdit", 60 "libclangAST", 61 "libclangLex", 62 "libclangBasic", 63 "libLLVMIRReader", 64 "libLLVMAsmParser", 65 "libLLVMAsmPrinter", 66 "libLLVMBitReader", 67 "libLLVMBitWriter", 68 "libLLVMMC", 69 "libLLVMMCParser", 70 "libLLVMCore", 71 "libLLVMOption", 72 "libLLVMProfileData", 73 "libLLVMObject", 74 "libLLVMMCDisassembler", 75 "libLLVMSupport", 76 ], 77 78 shared_libs: [ 79 "libprotobuf-cpp-full", 80 ], 81 } 82 83 cc_defaults { 84 name: "header-abi-linker-lib-defaults", 85 86 static_libs: [ 87 "libLLVMSupport", 88 "libheader-abi-util", 89 ], 90 91 shared_libs: [ 92 "libprotobuf-cpp-full", 93 ], 94 } 95 96 cc_library_static { 97 name: "libheader-checker-proto", 98 host_supported: true, 99 export_include_dirs: ["."], 100 101 srcs: [ 102 "proto/abi_dump.proto", 103 "proto/abi_diff.proto", 104 ], 105 106 proto: { 107 export_proto_headers: true, 108 type: "full", 109 }, 110 111 cflags: [ 112 "-Wcast-qual", 113 "-Wno-long-long", 114 "-Wno-unused-parameter", 115 ], 116 } 117 118 cc_binary_host { 119 name: "header-abi-dumper", 120 121 defaults: [ 122 "header-checker-defaults", 123 "header-checker-lib-defaults", 124 ], 125 126 srcs: [ 127 "header-abi-dumper/src/*.cpp", 128 ], 129 130 static_libs: [ 131 "libheader-checker-proto", 132 "libheader-abi-util", 133 ], 134 135 target: { 136 linux: { 137 host_ldlibs: [ 138 "-ldl", 139 "-lpthread", 140 ], 141 }, 142 darwin: { 143 host_ldlibs: [ 144 "-ldl", 145 "-lpthread", 146 ], 147 }, 148 }, 149 } 150 151 cc_binary_host { 152 name: "header-abi-linker", 153 154 defaults: [ 155 "header-checker-defaults", 156 "header-abi-linker-lib-defaults", 157 ], 158 159 srcs: [ 160 "header-abi-linker/src/*.cpp", 161 ], 162 163 static_libs: [ 164 "libheader-checker-proto", 165 ], 166 167 target: { 168 linux: { 169 host_ldlibs: [ 170 "-ldl", 171 "-lpthread", 172 ], 173 }, 174 darwin: { 175 host_ldlibs: [ 176 "-ldl", 177 "-lpthread", 178 ], 179 }, 180 }, 181 } 182 183 cc_binary_host { 184 name: "header-abi-diff", 185 186 defaults: [ 187 "header-checker-defaults", 188 "header-abi-linker-lib-defaults", 189 ], 190 191 srcs: [ 192 "header-abi-diff/src/*.cpp", 193 ], 194 195 static_libs: [ 196 "libheader-checker-proto", 197 ], 198 199 target: { 200 linux: { 201 host_ldlibs: [ 202 "-ldl", 203 "-lpthread", 204 ], 205 }, 206 darwin: { 207 host_ldlibs: [ 208 "-ldl", 209 "-lpthread", 210 ], 211 }, 212 }, 213 } 214 215 cc_binary_host { 216 name: "merge-abi-diff", 217 218 defaults: [ 219 "header-checker-defaults", 220 "header-abi-linker-lib-defaults", 221 ], 222 223 srcs: [ 224 "merge-abi-diff/src/*.cpp", 225 ], 226 227 static_libs: [ 228 "libheader-checker-proto", 229 ], 230 231 target: { 232 linux: { 233 host_ldlibs: [ 234 "-ldl", 235 "-lpthread", 236 ], 237 }, 238 darwin: { 239 host_ldlibs: [ 240 "-ldl", 241 "-lpthread", 242 ], 243 }, 244 }, 245 } 246 247 cc_library_static { 248 name: "libheader-abi-util", 249 defaults: [ 250 "header-checker-defaults", 251 ], 252 host_supported: true, 253 export_include_dirs: ["header-abi-util/include"], 254 local_include_dirs: ["header-abi-util/include"], 255 256 srcs: [ 257 "header-abi-util/src/*.cpp" 258 ], 259 static_libs: [ 260 "libLLVMSupport", 261 ], 262 cflags: [ 263 "-Wcast-qual", 264 "-Wno-long-long", 265 "-Wno-unused-parameter", 266 ], 267 } 268