Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 1 | cc_defaults { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 2 | name: "llvm-defaults", |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 3 | defaults: ["llvm-defaults-no-generated-headers"], |
| 4 | header_libs: ["llvm-headers"], |
Chih-Hung Hsieh | a8de068 | 2017-08-09 10:27:27 -0700 | [diff] [blame] | 5 | tidy_checks: [ |
| 6 | "-google-build-*", |
| 7 | "-google-global-*", |
| 8 | ], |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 9 | } |
| 10 | |
| 11 | // This module defines all of the defaults used to compiled llvm, except for |
| 12 | // the generated headers. It is necessary to avoid a circular dependency |
| 13 | // from the tblgen tool used to generate the headers to the generated headers. |
| 14 | llvm_defaults { |
| 15 | name: "llvm-defaults-no-generated-headers", |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 16 | |
| 17 | host_supported: true, |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 18 | |
| 19 | cflags: [ |
| 20 | "-D_GNU_SOURCE", |
| 21 | "-D__STDC_LIMIT_MACROS", |
| 22 | "-D__STDC_CONSTANT_MACROS", |
| 23 | "-D__STDC_FORMAT_MACROS", |
| 24 | "-fomit-frame-pointer", |
| 25 | "-Wall", |
| 26 | "-W", |
Yi Kong | fccb4bf | 2018-01-03 12:55:42 -0800 | [diff] [blame^] | 27 | "-Wno-cast-qual", |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 28 | "-Wno-sign-compare", |
| 29 | "-Wno-unused-parameter", |
| 30 | "-Wno-maybe-uninitialized", |
| 31 | "-Wno-missing-field-initializers", |
| 32 | "-Wwrite-strings", |
| 33 | "-Werror", |
| 34 | "-Dsprintf=sprintf", |
| 35 | ], |
| 36 | |
| 37 | cppflags: [ |
| 38 | "-Wno-sign-promo", |
| 39 | "-std=c++11", |
| 40 | ], |
| 41 | |
Yi Kong | c3f7949 | 2017-05-01 14:53:13 -0700 | [diff] [blame] | 42 | clang_cflags: [ |
| 43 | // Temporarily suppress the warnings http://b/37867503 |
| 44 | "-Wno-error=unused-lambda-capture", |
| 45 | "-Wno-error=user-defined-warnings", |
| 46 | ], |
| 47 | |
Chih-Hung Hsieh | a8de068 | 2017-08-09 10:27:27 -0700 | [diff] [blame] | 48 | tidy_checks: [ |
| 49 | "-google-build-*", |
| 50 | "-google-global-*", |
| 51 | ], |
| 52 | |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 53 | header_libs: ["llvm-headers-no-generated-headers"], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 54 | |
| 55 | target: { |
| 56 | android: { |
| 57 | cflags: [ |
| 58 | "-finline-functions", |
| 59 | ], |
Dan Willemsen | a880871 | 2017-10-16 20:08:05 -0700 | [diff] [blame] | 60 | }, |
| 61 | linux: { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 62 | cppflags: [ |
| 63 | "-Woverloaded-virtual", |
| 64 | ], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 65 | }, |
| 66 | host: { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 67 | cppflags: [ |
| 68 | "-fno-rtti", |
| 69 | "-fno-exceptions", |
| 70 | ], |
| 71 | }, |
| 72 | windows: { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 73 | // Disable certain warnings for use with mingw. |
| 74 | // We also must undefine WIN32_LEAN_AND_MEAN, since it is being passed globally |
| 75 | // on the command line, and LLVM defines this internally itself. |
| 76 | cflags: [ |
| 77 | "-Wno-array-bounds", |
| 78 | "-Wno-comment", |
| 79 | "-UWIN32_LEAN_AND_MEAN", |
| 80 | ], |
| 81 | |
| 82 | host_ldlibs: ["-luuid"], |
| 83 | }, |
Dan Willemsen | a32f663 | 2017-10-02 10:41:09 -0700 | [diff] [blame] | 84 | linux_glibc: { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 85 | // Add on ncurses to have support for terminfo |
| 86 | host_ldlibs: [ |
| 87 | "-lncurses", |
| 88 | "-lgcc_s", |
| 89 | ], |
| 90 | }, |
| 91 | darwin: { |
| 92 | cppflags: [ |
| 93 | "-Wno-deprecated-declarations", |
| 94 | "-Woverloaded-virtual", |
| 95 | ], |
| 96 | |
| 97 | // Add on ncurses to have support for terminfo |
Colin Cross | d4da2d9 | 2016-12-01 14:49:11 -0800 | [diff] [blame] | 98 | host_ldlibs: [ |
Colin Cross | d4da2d9 | 2016-12-01 14:49:11 -0800 | [diff] [blame] | 99 | "-lncurses", |
| 100 | ], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 101 | }, |
| 102 | }, |
| 103 | } |
| 104 | |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 105 | cc_library_headers { |
| 106 | name: "llvm-headers-no-generated-headers", |
Jiyong Park | 764e9266 | 2017-08-10 20:09:55 +0900 | [diff] [blame] | 107 | vendor_available: true, |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 108 | host_supported: true, |
| 109 | export_include_dirs: ["include"], |
| 110 | target: { |
| 111 | android: { |
| 112 | export_include_dirs: ["device/include"], |
| 113 | }, |
| 114 | host: { |
| 115 | export_include_dirs: ["host/include"], |
| 116 | }, |
Dan Willemsen | 399e474 | 2017-03-15 16:58:24 -0700 | [diff] [blame] | 117 | linux_bionic: { |
| 118 | enabled: true, |
| 119 | }, |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 120 | windows: { |
| 121 | enabled: true, |
| 122 | }, |
| 123 | }, |
| 124 | } |
| 125 | |
| 126 | cc_library_headers { |
| 127 | name: "llvm-headers", |
Jiyong Park | 764e9266 | 2017-08-10 20:09:55 +0900 | [diff] [blame] | 128 | vendor_available: true, |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 129 | host_supported: true, |
| 130 | header_libs: ["llvm-headers-no-generated-headers"], |
| 131 | export_header_lib_headers: ["llvm-headers-no-generated-headers"], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 132 | generated_headers: [ |
| 133 | "llvm-gen-attributes", |
| 134 | "llvm-gen-intrinsics", |
| 135 | ], |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 136 | export_generated_headers: [ |
| 137 | "llvm-gen-attributes", |
| 138 | "llvm-gen-intrinsics", |
| 139 | ], |
| 140 | target: { |
| 141 | windows: { |
| 142 | enabled: true, |
| 143 | }, |
| 144 | }, |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | llvm_tblgen { |
| 148 | name: "llvm-gen-attributes", |
| 149 | in: "include/llvm/IR/Attributes.td", |
| 150 | outs: ["llvm/IR/Attributes.inc"], |
| 151 | } |
| 152 | |
| 153 | llvm_tblgen { |
| 154 | name: "llvm-gen-intrinsics", |
| 155 | in: "include/llvm/IR/Intrinsics.td", |
| 156 | outs: ["llvm/IR/Intrinsics.gen"], |
| 157 | } |
| 158 | |
Colin Cross | d0b69265 | 2016-12-08 09:49:38 -0800 | [diff] [blame] | 159 | force_build_llvm_components_defaults { |
| 160 | name: "force_build_llvm_components", |
| 161 | // Host build disabled by soong/llvm.go unless FORCE_BUILD_LLVM_COMPONENTS |
| 162 | // environment variable is set |
| 163 | } |
| 164 | |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 165 | // LLVM shared library build |
| 166 | |
| 167 | llvm_arm_static_libraries = [ |
| 168 | "libLLVMARMCodeGen", |
| 169 | "libLLVMARMAsmParser", |
| 170 | "libLLVMARMAsmPrinter", |
| 171 | "libLLVMARMInfo", |
| 172 | "libLLVMARMDesc", |
| 173 | "libLLVMARMDisassembler", |
| 174 | ] |
| 175 | |
| 176 | llvm_x86_static_libraries = [ |
| 177 | "libLLVMX86CodeGen", |
| 178 | "libLLVMX86Info", |
| 179 | "libLLVMX86Desc", |
| 180 | "libLLVMX86AsmParser", |
| 181 | "libLLVMX86AsmPrinter", |
| 182 | "libLLVMX86Utils", |
| 183 | "libLLVMX86Disassembler", |
| 184 | ] |
| 185 | |
| 186 | llvm_mips_static_libraries = [ |
| 187 | "libLLVMMipsCodeGen", |
| 188 | "libLLVMMipsInfo", |
| 189 | "libLLVMMipsDesc", |
| 190 | "libLLVMMipsAsmParser", |
| 191 | "libLLVMMipsAsmPrinter", |
| 192 | "libLLVMMipsDisassembler", |
| 193 | ] |
| 194 | |
| 195 | llvm_aarch64_static_libraries = [ |
| 196 | "libLLVMAArch64CodeGen", |
| 197 | "libLLVMAArch64Info", |
| 198 | "libLLVMAArch64Desc", |
| 199 | "libLLVMAArch64AsmParser", |
| 200 | "libLLVMAArch64AsmPrinter", |
| 201 | "libLLVMAArch64Utils", |
| 202 | "libLLVMAArch64Disassembler", |
| 203 | ] |
| 204 | |
Pirama Arumuga Nainar | c6f1de7 | 2017-08-03 11:31:35 -0700 | [diff] [blame] | 205 | cc_library_shared { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 206 | host_supported: true, |
Pirama Arumuga Nainar | c6f1de7 | 2017-08-03 11:31:35 -0700 | [diff] [blame] | 207 | name: "libLLVM_android", |
Colin Cross | d0b69265 | 2016-12-08 09:49:38 -0800 | [diff] [blame] | 208 | defaults: [ |
| 209 | "llvm-defaults", |
| 210 | "force_build_llvm_components", |
| 211 | ], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 212 | |
| 213 | whole_static_libs: [ |
| 214 | // pre static libraries |
| 215 | "libLLVMLinker", |
| 216 | "libLLVMipo", |
| 217 | "libLLVMDebugInfoDWARF", |
| 218 | "libLLVMDebugInfoPDB", |
| 219 | "libLLVMSymbolize", |
| 220 | "libLLVMIRReader", |
| 221 | "libLLVMBitWriter", |
| 222 | "libLLVMBitReader", |
| 223 | |
| 224 | // post static libraries |
| 225 | "libLLVMLTO", |
| 226 | "libLLVMAsmPrinter", |
| 227 | "libLLVMSelectionDAG", |
| 228 | "libLLVMCodeGen", |
| 229 | "libLLVMDebugInfoCodeView", |
| 230 | "libLLVMObject", |
| 231 | "libLLVMScalarOpts", |
| 232 | "libLLVMInstCombine", |
| 233 | "libLLVMInstrumentation", |
| 234 | "libLLVMTransformObjCARC", |
| 235 | "libLLVMTransformUtils", |
| 236 | "libLLVMAnalysis", |
| 237 | "libLLVMTarget", |
| 238 | "libLLVMGlobalISel", |
| 239 | "libLLVMMCDisassembler", |
| 240 | "libLLVMMC", |
| 241 | "libLLVMMCParser", |
| 242 | "libLLVMCore", |
| 243 | "libLLVMAsmParser", |
| 244 | "libLLVMOption", |
| 245 | "libLLVMSupport", |
| 246 | "libLLVMVectorize", |
| 247 | "libLLVMProfileData", |
| 248 | "libLLVMProfileDataCoverage", |
| 249 | "libLLVMLibDriver", |
Nicolas Norvez | a5aee7a | 2017-06-23 13:56:49 -0700 | [diff] [blame] | 250 | "libLLVMExecutionEngine", |
| 251 | "libLLVMRuntimeDyld", |
| 252 | "libLLVMMCJIT", |
| 253 | "libLLVMOrcJIT", |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 254 | ], |
| 255 | |
Colin Cross | 7e5fa1a | 2016-12-06 16:42:05 -0800 | [diff] [blame] | 256 | export_include_dirs: ["include"], |
| 257 | |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 258 | target: { |
| 259 | host: { |
| 260 | // Host build pulls in all ARM, Mips, X86 components. |
Nicolas Norvez | a5aee7a | 2017-06-23 13:56:49 -0700 | [diff] [blame] | 261 | whole_static_libs: llvm_arm_static_libraries + |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 262 | llvm_aarch64_static_libraries + |
| 263 | llvm_mips_static_libraries + |
| 264 | llvm_x86_static_libraries, |
Colin Cross | 7e5fa1a | 2016-12-06 16:42:05 -0800 | [diff] [blame] | 265 | export_include_dirs: ["host/include"], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 266 | }, |
| 267 | windows: { |
Colin Cross | d4da2d9 | 2016-12-01 14:49:11 -0800 | [diff] [blame] | 268 | enabled: true, |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 269 | host_ldlibs: [ |
| 270 | "-limagehlp", |
| 271 | "-lpsapi", |
| 272 | "-lole32", |
| 273 | "-lversion", |
| 274 | ], |
| 275 | }, |
Colin Cross | 7e5fa1a | 2016-12-06 16:42:05 -0800 | [diff] [blame] | 276 | android: { |
| 277 | export_include_dirs: ["device/include"], |
| 278 | }, |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 279 | android_arm: { |
| 280 | whole_static_libs: llvm_arm_static_libraries, |
| 281 | }, |
| 282 | android_x86: { |
| 283 | whole_static_libs: llvm_x86_static_libraries + |
| 284 | llvm_arm_static_libraries + |
| 285 | llvm_aarch64_static_libraries, |
| 286 | }, |
| 287 | android_x86_64: { |
| 288 | whole_static_libs: llvm_x86_static_libraries + |
| 289 | llvm_arm_static_libraries + |
| 290 | llvm_aarch64_static_libraries, |
| 291 | }, |
| 292 | android_mips: { |
| 293 | whole_static_libs: llvm_mips_static_libraries, |
| 294 | }, |
| 295 | android_mips64: { |
| 296 | whole_static_libs: llvm_mips_static_libraries, |
| 297 | }, |
| 298 | android_arm64: { |
| 299 | whole_static_libs: llvm_aarch64_static_libraries + |
| 300 | llvm_arm_static_libraries, |
| 301 | }, |
| 302 | }, |
| 303 | } |
| 304 | |
| 305 | subdirs = [ |
| 306 | "soong", |
Colin Cross | d4da2d9 | 2016-12-01 14:49:11 -0800 | [diff] [blame] | 307 | "lib", |
| 308 | "tools/*", |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 309 | "utils/*", |
| 310 | ] |