Bob Badour | c469a90 | 2021-02-12 17:57:32 -0800 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["external_clang_license"], |
| 3 | } |
| 4 | |
| 5 | // Added automatically by a large-scale-change that took the approach of |
| 6 | // 'apply every license found to every target'. While this makes sure we respect |
| 7 | // every license restriction, it may not be entirely correct. |
| 8 | // |
| 9 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 10 | // |
| 11 | // Please consider splitting the single license below into multiple licenses, |
| 12 | // taking care not to lose any license_kind information, and overriding the |
| 13 | // default license using the 'licenses: [...]' property on targets as needed. |
| 14 | // |
| 15 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 16 | // to attach the license to, and including a comment whether the files may be |
| 17 | // used in the current project. |
| 18 | // |
| 19 | // large-scale-change included anything that looked like it might be a license |
| 20 | // text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. |
| 21 | // |
| 22 | // Please consider removing redundant or irrelevant files from 'license_text:'. |
| 23 | // |
| 24 | // large-scale-change filtered out the below license kinds as false-positives: |
| 25 | // SPDX-license-identifier-GPL |
| 26 | // See: http://go/android-license-faq |
| 27 | license { |
| 28 | name: "external_clang_license", |
| 29 | visibility: [":__subpackages__"], |
| 30 | license_kinds: [ |
| 31 | "SPDX-license-identifier-Apache-2.0", |
| 32 | "SPDX-license-identifier-BSD", |
| 33 | "SPDX-license-identifier-MIT", |
| 34 | "SPDX-license-identifier-NCSA", |
| 35 | ], |
| 36 | license_text: [ |
| 37 | "LICENSE.TXT", |
| 38 | "NOTICE", |
| 39 | ], |
| 40 | } |
| 41 | |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 42 | cc_defaults { |
| 43 | name: "clang-defaults", |
| 44 | defaults: [ |
| 45 | "llvm-defaults", |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 46 | ], |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 47 | |
Colin Cross | fa52df7 | 2016-12-14 16:45:19 -0800 | [diff] [blame] | 48 | header_libs: ["clang-headers"], |
| 49 | |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 50 | cflags: [ |
| 51 | "-pedantic", |
Yi Kong | f6c01d1 | 2018-01-03 11:58:13 -0800 | [diff] [blame] | 52 | "-Wno-cast-qual", |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 53 | "-Wno-long-long", |
George Burgess IV | f639faf | 2020-05-11 17:39:38 -0700 | [diff] [blame] | 54 | "-Wno-unreachable-code-loop-increment", |
Pirama Arumuga Nainar | e5498b6 | 2018-11-05 17:04:18 -0800 | [diff] [blame] | 55 | "-Wno-unused-lambda-capture", |
George Burgess IV | f639faf | 2020-05-11 17:39:38 -0700 | [diff] [blame] | 56 | "-Wno-unused-private-field", |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 57 | ], |
| 58 | |
| 59 | include_dirs: [ |
| 60 | "external/clang/include", |
| 61 | "external/clang/lib/CodeGen", |
| 62 | ], |
| 63 | |
Chih-Hung Hsieh | 3d55563 | 2017-08-09 15:52:17 -0700 | [diff] [blame] | 64 | tidy_checks: [ |
| 65 | "-google-runtime-member-string-references", |
| 66 | ], |
| 67 | |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 68 | target: { |
| 69 | windows: { |
| 70 | enabled: true, |
| 71 | cflags: [ |
| 72 | // This triggers an assertion on cross Windows builds. |
| 73 | "-Wno-error=uninitialized", |
| 74 | ], |
| 75 | }, |
Pirama Arumuga Nainar | df01d33 | 2017-10-31 13:48:44 -0700 | [diff] [blame] | 76 | not_windows: { |
| 77 | cflags: [ |
| 78 | "-Wno-unused-lambda-capture", |
| 79 | ], |
| 80 | }, |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 81 | }, |
| 82 | |
| 83 | } |
| 84 | |
Colin Cross | fa52df7 | 2016-12-14 16:45:19 -0800 | [diff] [blame] | 85 | clang_generated_headers = [ |
| 86 | "clang-gen-options", |
| 87 | "clang-gen-attributes", |
| 88 | "clang-gen-checkers", |
| 89 | "clang-gen-comment-commands", |
| 90 | "clang-gen-comment-html-named-character-references", |
| 91 | "clang-gen-html-tags", |
| 92 | "clang-gen-comment-nodes", |
| 93 | "clang-gen-diagnostics", |
| 94 | "clang-gen-declnodes", |
| 95 | "clang-gen-statnodes", |
| 96 | "clang-gen-arm-neon", |
| 97 | "clang-version", |
| 98 | "llvm-gen-attributes", |
| 99 | "llvm-gen-intrinsics", |
| 100 | ] |
| 101 | |
| 102 | cc_library_headers { |
| 103 | name: "clang-headers", |
Jiyong Park | 636d615 | 2017-08-10 20:34:59 +0900 | [diff] [blame] | 104 | vendor_available: true, |
Justin Yun | cac8836 | 2020-11-11 16:12:34 +0900 | [diff] [blame] | 105 | product_available: true, |
Colin Cross | fa52df7 | 2016-12-14 16:45:19 -0800 | [diff] [blame] | 106 | host_supported: true, |
Victor Khimenko | 0e14775 | 2020-07-02 01:25:09 +0200 | [diff] [blame] | 107 | // TODO(b/153609531): remove when no longer needed. |
| 108 | native_bridge_supported: true, |
Colin Cross | fa52df7 | 2016-12-14 16:45:19 -0800 | [diff] [blame] | 109 | generated_headers: clang_generated_headers, |
| 110 | export_include_dirs: ["include"], |
| 111 | export_generated_headers: clang_generated_headers, |
| 112 | target: { |
| 113 | windows: { |
| 114 | enabled: true, |
| 115 | }, |
| 116 | }, |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | llvm_tblgen { |
| 120 | name: "clang-gen-options", |
| 121 | in: "include/clang/Driver/Options.td", |
| 122 | outs: ["clang/Driver/Options.inc"], |
| 123 | } |
| 124 | |
| 125 | clang_tblgen { |
| 126 | name: "clang-gen-attributes", |
| 127 | in: "include/clang/Basic/Attr.td", |
| 128 | outs: [ |
| 129 | "clang/AST/AttrDump.inc", |
| 130 | "clang/AST/AttrImpl.inc", |
| 131 | "clang/AST/Attrs.inc", |
| 132 | "clang/AST/AttrVisitor.inc", |
| 133 | "clang/Basic/AttrHasAttributeImpl.inc", |
| 134 | "clang/Basic/AttrList.inc", |
| 135 | "clang/Parse/AttrParserStringSwitches.inc", |
| 136 | "clang/Sema/AttrParsedAttrImpl.inc", |
| 137 | "clang/Sema/AttrParsedAttrKinds.inc", |
| 138 | "clang/Sema/AttrParsedAttrList.inc", |
| 139 | "clang/Sema/AttrSpellingListIndex.inc", |
| 140 | "clang/Sema/AttrTemplateInstantiate.inc", |
| 141 | "clang/Serialization/AttrPCHRead.inc", |
| 142 | "clang/Serialization/AttrPCHWrite.inc", |
| 143 | ], |
| 144 | } |
| 145 | |
| 146 | clang_tblgen { |
| 147 | name: "clang-gen-checkers", |
| 148 | in: "include/clang/StaticAnalyzer/Checkers/Checkers.td", |
| 149 | outs: ["clang/StaticAnalyzer/Checkers/Checkers.inc"], |
| 150 | } |
| 151 | |
| 152 | clang_tblgen { |
| 153 | name: "clang-gen-comment-commands", |
| 154 | in: "include/clang/AST/CommentCommands.td", |
| 155 | outs: [ |
| 156 | "clang/AST/CommentCommandInfo.inc", |
| 157 | "clang/AST/CommentCommandList.inc", |
| 158 | ], |
| 159 | } |
| 160 | |
| 161 | clang_tblgen { |
| 162 | name: "clang-gen-comment-html-named-character-references", |
| 163 | in: "include/clang/AST/CommentHTMLNamedCharacterReferences.td", |
| 164 | outs: ["clang/AST/CommentHTMLNamedCharacterReferences.inc"], |
| 165 | } |
| 166 | |
| 167 | clang_tblgen { |
| 168 | name: "clang-gen-html-tags", |
| 169 | in: "include/clang/AST/CommentHTMLTags.td", |
| 170 | outs: [ |
| 171 | "clang/AST/CommentHTMLTagsProperties.inc", |
| 172 | "clang/AST/CommentHTMLTags.inc", |
| 173 | ], |
| 174 | } |
| 175 | |
| 176 | clang_tblgen { |
| 177 | name: "clang-gen-comment-nodes", |
| 178 | in: "include/clang/Basic/CommentNodes.td", |
| 179 | outs: ["clang/AST/CommentNodes.inc"], |
| 180 | } |
| 181 | |
| 182 | clang_tblgen { |
| 183 | name: "clang-gen-diagnostics", |
| 184 | in: "include/clang/Basic/Diagnostic.td", |
| 185 | outs: [ |
| 186 | "clang/Basic/DiagnosticAnalysisKinds.inc", |
| 187 | "clang/Basic/DiagnosticASTKinds.inc", |
| 188 | "clang/Basic/DiagnosticCommentKinds.inc", |
| 189 | "clang/Basic/DiagnosticCommonKinds.inc", |
| 190 | "clang/Basic/DiagnosticDriverKinds.inc", |
| 191 | "clang/Basic/DiagnosticFrontendKinds.inc", |
| 192 | "clang/Basic/DiagnosticLexKinds.inc", |
| 193 | "clang/Basic/DiagnosticParseKinds.inc", |
| 194 | "clang/Basic/DiagnosticSemaKinds.inc", |
| 195 | "clang/Basic/DiagnosticSerializationKinds.inc", |
| 196 | "clang/Basic/DiagnosticGroups.inc", |
| 197 | "clang/Basic/DiagnosticIndexName.inc", |
| 198 | ], |
| 199 | } |
| 200 | |
| 201 | clang_tblgen { |
| 202 | name: "clang-gen-declnodes", |
| 203 | in: "include/clang/Basic/DeclNodes.td", |
| 204 | outs: ["clang/AST/DeclNodes.inc"], |
| 205 | } |
| 206 | |
| 207 | clang_tblgen { |
| 208 | name: "clang-gen-statnodes", |
| 209 | in: "include/clang/Basic/StmtNodes.td", |
| 210 | outs: ["clang/AST/StmtNodes.inc"], |
| 211 | } |
| 212 | |
| 213 | clang_tblgen { |
| 214 | name: "clang-gen-arm-neon", |
| 215 | in: "include/clang/Basic/arm_neon.td", |
| 216 | outs: [ |
| 217 | "clang/Basic/arm_neon.inc", |
| 218 | "clang/Basic/arm_neon.h", |
| 219 | ], |
| 220 | } |
| 221 | |
| 222 | genrule { |
| 223 | name: "clang-version", |
| 224 | cmd: "$(location) $(in) > $(out)", |
| 225 | tool_files: [ |
| 226 | "clang-version-inc.py", |
| 227 | "version.py", |
| 228 | ], |
| 229 | srcs: [ |
| 230 | "include/clang/Basic/Version.inc.in", |
| 231 | ], |
| 232 | out: ["clang/Basic/Version.inc"], |
| 233 | } |
| 234 | |
Pirama Arumuga Nainar | d5a8197 | 2017-08-03 11:29:27 -0700 | [diff] [blame] | 235 | cc_library_shared { |
| 236 | name: "libclang_android", |
Colin Cross | a7df791 | 2016-12-08 10:07:05 -0800 | [diff] [blame] | 237 | defaults: [ |
| 238 | "clang-defaults", |
| 239 | "force_build_llvm_components", |
| 240 | ], |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 241 | |
| 242 | host_supported: true, |
| 243 | |
| 244 | whole_static_libs: [ |
| 245 | "libclangAnalysis", |
| 246 | "libclangAST", |
| 247 | "libclangASTMatchers", |
| 248 | "libclangBasic", |
| 249 | "libclangCodeGen", |
| 250 | "libclangDriver", |
| 251 | "libclangEdit", |
| 252 | "libclangFormat", |
| 253 | "libclangFrontend", |
| 254 | "libclangIndex", |
| 255 | "libclangLex", |
| 256 | "libclangLibclang", |
| 257 | "libclangParse", |
| 258 | "libclangRewrite", |
| 259 | "libclangRewriteFrontend", |
| 260 | "libclangSema", |
| 261 | "libclangSerialization", |
| 262 | "libclangTooling", |
| 263 | "libclangToolingCore", |
| 264 | ], |
| 265 | |
Pirama Arumuga Nainar | d5a8197 | 2017-08-03 11:29:27 -0700 | [diff] [blame] | 266 | export_shared_lib_headers: ["libLLVM_android"], |
| 267 | shared_libs: ["libLLVM_android"], |
Colin Cross | fa52df7 | 2016-12-14 16:45:19 -0800 | [diff] [blame] | 268 | export_header_lib_headers: ["clang-headers"], |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 269 | |
| 270 | target: { |
| 271 | windows: { |
| 272 | host_ldlibs: [ |
| 273 | "-limagehlp", |
| 274 | "-lpsapi", |
| 275 | "-lversion", |
| 276 | ], |
| 277 | }, |
Dan Willemsen | 7669bc1 | 2017-09-28 17:30:40 -0700 | [diff] [blame] | 278 | not_windows: { |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 279 | shared_libs: ["libc++"], |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 280 | }, |
| 281 | }, |
| 282 | |
| 283 | product_variables: { |
| 284 | unbundled_build: { |
| 285 | // Don't build the library in unbundled branches. |
| 286 | enabled: false, |
| 287 | }, |
| 288 | }, |
| 289 | } |
| 290 | |
Dan Willemsen | 46ac0e8 | 2021-09-15 23:27:53 -0700 | [diff] [blame] | 291 | genrule { |
| 292 | name: "renderscript-clang-include", |
| 293 | visibility: ["//development/build"], |
| 294 | tools: ["soong_zip"], |
| 295 | cmd: "$(location soong_zip) -o $(out) -P renderscript/clang-include " + |
| 296 | "-C $$(dirname $(location LICENSE.TXT))/lib/Headers -D $$(dirname $(location LICENSE.TXT))/lib/Headers " + |
| 297 | "-C $$(dirname $(location LICENSE.TXT)) -f $(location LICENSE.TXT)", |
| 298 | srcs: [ |
| 299 | "lib/Headers/**/*", |
| 300 | "LICENSE.TXT", |
| 301 | ], |
| 302 | out: ["clang-include.zip"], |
| 303 | } |