Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "clang-defaults", |
| 3 | defaults: [ |
| 4 | "llvm-defaults", |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 5 | ], |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 6 | |
Colin Cross | fa52df7 | 2016-12-14 16:45:19 -0800 | [diff] [blame] | 7 | header_libs: ["clang-headers"], |
| 8 | |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 9 | cflags: [ |
| 10 | "-pedantic", |
Yi Kong | f6c01d1 | 2018-01-03 11:58:13 -0800 | [diff] [blame] | 11 | "-Wno-cast-qual", |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 12 | "-Wno-long-long", |
Chih-Hung Hsieh | 7ce1af5 | 2018-02-14 11:36:54 -0800 | [diff] [blame] | 13 | "-Wno-unused-private-field", |
Pirama Arumuga Nainar | e5498b6 | 2018-11-05 17:04:18 -0800 | [diff] [blame] | 14 | "-Wno-unused-lambda-capture", |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 15 | ], |
| 16 | |
| 17 | include_dirs: [ |
| 18 | "external/clang/include", |
| 19 | "external/clang/lib/CodeGen", |
| 20 | ], |
| 21 | |
Chih-Hung Hsieh | 3d55563 | 2017-08-09 15:52:17 -0700 | [diff] [blame] | 22 | tidy_checks: [ |
| 23 | "-google-runtime-member-string-references", |
| 24 | ], |
| 25 | |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 26 | target: { |
| 27 | windows: { |
| 28 | enabled: true, |
| 29 | cflags: [ |
| 30 | // This triggers an assertion on cross Windows builds. |
| 31 | "-Wno-error=uninitialized", |
| 32 | ], |
| 33 | }, |
Pirama Arumuga Nainar | df01d33 | 2017-10-31 13:48:44 -0700 | [diff] [blame] | 34 | not_windows: { |
| 35 | cflags: [ |
| 36 | "-Wno-unused-lambda-capture", |
| 37 | ], |
| 38 | }, |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 39 | }, |
| 40 | |
| 41 | } |
| 42 | |
Colin Cross | fa52df7 | 2016-12-14 16:45:19 -0800 | [diff] [blame] | 43 | clang_generated_headers = [ |
| 44 | "clang-gen-options", |
| 45 | "clang-gen-attributes", |
| 46 | "clang-gen-checkers", |
| 47 | "clang-gen-comment-commands", |
| 48 | "clang-gen-comment-html-named-character-references", |
| 49 | "clang-gen-html-tags", |
| 50 | "clang-gen-comment-nodes", |
| 51 | "clang-gen-diagnostics", |
| 52 | "clang-gen-declnodes", |
| 53 | "clang-gen-statnodes", |
| 54 | "clang-gen-arm-neon", |
| 55 | "clang-version", |
| 56 | "llvm-gen-attributes", |
| 57 | "llvm-gen-intrinsics", |
| 58 | ] |
| 59 | |
| 60 | cc_library_headers { |
| 61 | name: "clang-headers", |
Jiyong Park | 636d615 | 2017-08-10 20:34:59 +0900 | [diff] [blame] | 62 | vendor_available: true, |
Colin Cross | fa52df7 | 2016-12-14 16:45:19 -0800 | [diff] [blame] | 63 | host_supported: true, |
Victor Khimenko | 7edf675 | 2020-07-02 01:25:09 +0200 | [diff] [blame] | 64 | // TODO(b/153609531): remove when no longer needed. |
| 65 | native_bridge_supported: true, |
Colin Cross | fa52df7 | 2016-12-14 16:45:19 -0800 | [diff] [blame] | 66 | generated_headers: clang_generated_headers, |
| 67 | export_include_dirs: ["include"], |
| 68 | export_generated_headers: clang_generated_headers, |
| 69 | target: { |
| 70 | windows: { |
| 71 | enabled: true, |
| 72 | }, |
| 73 | }, |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | llvm_tblgen { |
| 77 | name: "clang-gen-options", |
| 78 | in: "include/clang/Driver/Options.td", |
| 79 | outs: ["clang/Driver/Options.inc"], |
| 80 | } |
| 81 | |
| 82 | clang_tblgen { |
| 83 | name: "clang-gen-attributes", |
| 84 | in: "include/clang/Basic/Attr.td", |
| 85 | outs: [ |
| 86 | "clang/AST/AttrDump.inc", |
| 87 | "clang/AST/AttrImpl.inc", |
| 88 | "clang/AST/Attrs.inc", |
| 89 | "clang/AST/AttrVisitor.inc", |
| 90 | "clang/Basic/AttrHasAttributeImpl.inc", |
| 91 | "clang/Basic/AttrList.inc", |
| 92 | "clang/Parse/AttrParserStringSwitches.inc", |
| 93 | "clang/Sema/AttrParsedAttrImpl.inc", |
| 94 | "clang/Sema/AttrParsedAttrKinds.inc", |
| 95 | "clang/Sema/AttrParsedAttrList.inc", |
| 96 | "clang/Sema/AttrSpellingListIndex.inc", |
| 97 | "clang/Sema/AttrTemplateInstantiate.inc", |
| 98 | "clang/Serialization/AttrPCHRead.inc", |
| 99 | "clang/Serialization/AttrPCHWrite.inc", |
| 100 | ], |
| 101 | } |
| 102 | |
| 103 | clang_tblgen { |
| 104 | name: "clang-gen-checkers", |
| 105 | in: "include/clang/StaticAnalyzer/Checkers/Checkers.td", |
| 106 | outs: ["clang/StaticAnalyzer/Checkers/Checkers.inc"], |
| 107 | } |
| 108 | |
| 109 | clang_tblgen { |
| 110 | name: "clang-gen-comment-commands", |
| 111 | in: "include/clang/AST/CommentCommands.td", |
| 112 | outs: [ |
| 113 | "clang/AST/CommentCommandInfo.inc", |
| 114 | "clang/AST/CommentCommandList.inc", |
| 115 | ], |
| 116 | } |
| 117 | |
| 118 | clang_tblgen { |
| 119 | name: "clang-gen-comment-html-named-character-references", |
| 120 | in: "include/clang/AST/CommentHTMLNamedCharacterReferences.td", |
| 121 | outs: ["clang/AST/CommentHTMLNamedCharacterReferences.inc"], |
| 122 | } |
| 123 | |
| 124 | clang_tblgen { |
| 125 | name: "clang-gen-html-tags", |
| 126 | in: "include/clang/AST/CommentHTMLTags.td", |
| 127 | outs: [ |
| 128 | "clang/AST/CommentHTMLTagsProperties.inc", |
| 129 | "clang/AST/CommentHTMLTags.inc", |
| 130 | ], |
| 131 | } |
| 132 | |
| 133 | clang_tblgen { |
| 134 | name: "clang-gen-comment-nodes", |
| 135 | in: "include/clang/Basic/CommentNodes.td", |
| 136 | outs: ["clang/AST/CommentNodes.inc"], |
| 137 | } |
| 138 | |
| 139 | clang_tblgen { |
| 140 | name: "clang-gen-diagnostics", |
| 141 | in: "include/clang/Basic/Diagnostic.td", |
| 142 | outs: [ |
| 143 | "clang/Basic/DiagnosticAnalysisKinds.inc", |
| 144 | "clang/Basic/DiagnosticASTKinds.inc", |
| 145 | "clang/Basic/DiagnosticCommentKinds.inc", |
| 146 | "clang/Basic/DiagnosticCommonKinds.inc", |
| 147 | "clang/Basic/DiagnosticDriverKinds.inc", |
| 148 | "clang/Basic/DiagnosticFrontendKinds.inc", |
| 149 | "clang/Basic/DiagnosticLexKinds.inc", |
| 150 | "clang/Basic/DiagnosticParseKinds.inc", |
| 151 | "clang/Basic/DiagnosticSemaKinds.inc", |
| 152 | "clang/Basic/DiagnosticSerializationKinds.inc", |
| 153 | "clang/Basic/DiagnosticGroups.inc", |
| 154 | "clang/Basic/DiagnosticIndexName.inc", |
| 155 | ], |
| 156 | } |
| 157 | |
| 158 | clang_tblgen { |
| 159 | name: "clang-gen-declnodes", |
| 160 | in: "include/clang/Basic/DeclNodes.td", |
| 161 | outs: ["clang/AST/DeclNodes.inc"], |
| 162 | } |
| 163 | |
| 164 | clang_tblgen { |
| 165 | name: "clang-gen-statnodes", |
| 166 | in: "include/clang/Basic/StmtNodes.td", |
| 167 | outs: ["clang/AST/StmtNodes.inc"], |
| 168 | } |
| 169 | |
| 170 | clang_tblgen { |
| 171 | name: "clang-gen-arm-neon", |
| 172 | in: "include/clang/Basic/arm_neon.td", |
| 173 | outs: [ |
| 174 | "clang/Basic/arm_neon.inc", |
| 175 | "clang/Basic/arm_neon.h", |
| 176 | ], |
| 177 | } |
| 178 | |
| 179 | genrule { |
| 180 | name: "clang-version", |
| 181 | cmd: "$(location) $(in) > $(out)", |
| 182 | tool_files: [ |
| 183 | "clang-version-inc.py", |
| 184 | "version.py", |
| 185 | ], |
| 186 | srcs: [ |
| 187 | "include/clang/Basic/Version.inc.in", |
| 188 | ], |
| 189 | out: ["clang/Basic/Version.inc"], |
| 190 | } |
| 191 | |
Pirama Arumuga Nainar | d5a8197 | 2017-08-03 11:29:27 -0700 | [diff] [blame] | 192 | cc_library_shared { |
| 193 | name: "libclang_android", |
Colin Cross | a7df791 | 2016-12-08 10:07:05 -0800 | [diff] [blame] | 194 | defaults: [ |
| 195 | "clang-defaults", |
| 196 | "force_build_llvm_components", |
| 197 | ], |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 198 | |
| 199 | host_supported: true, |
| 200 | |
| 201 | whole_static_libs: [ |
| 202 | "libclangAnalysis", |
| 203 | "libclangAST", |
| 204 | "libclangASTMatchers", |
| 205 | "libclangBasic", |
| 206 | "libclangCodeGen", |
| 207 | "libclangDriver", |
| 208 | "libclangEdit", |
| 209 | "libclangFormat", |
| 210 | "libclangFrontend", |
| 211 | "libclangIndex", |
| 212 | "libclangLex", |
| 213 | "libclangLibclang", |
| 214 | "libclangParse", |
| 215 | "libclangRewrite", |
| 216 | "libclangRewriteFrontend", |
| 217 | "libclangSema", |
| 218 | "libclangSerialization", |
| 219 | "libclangTooling", |
| 220 | "libclangToolingCore", |
| 221 | ], |
| 222 | |
Pirama Arumuga Nainar | d5a8197 | 2017-08-03 11:29:27 -0700 | [diff] [blame] | 223 | export_shared_lib_headers: ["libLLVM_android"], |
| 224 | shared_libs: ["libLLVM_android"], |
Colin Cross | fa52df7 | 2016-12-14 16:45:19 -0800 | [diff] [blame] | 225 | export_header_lib_headers: ["clang-headers"], |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 226 | |
| 227 | target: { |
| 228 | windows: { |
| 229 | host_ldlibs: [ |
| 230 | "-limagehlp", |
| 231 | "-lpsapi", |
| 232 | "-lversion", |
| 233 | ], |
| 234 | }, |
Dan Willemsen | 7669bc1 | 2017-09-28 17:30:40 -0700 | [diff] [blame] | 235 | not_windows: { |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 236 | shared_libs: ["libc++"], |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 237 | }, |
| 238 | }, |
| 239 | |
| 240 | product_variables: { |
| 241 | unbundled_build: { |
| 242 | // Don't build the library in unbundled branches. |
| 243 | enabled: false, |
| 244 | }, |
| 245 | }, |
| 246 | } |
| 247 | |
Colin Cross | cfa1764 | 2016-12-06 11:18:29 -0800 | [diff] [blame] | 248 | subdirs = [ |
| 249 | "lib", |
| 250 | "soong", |
| 251 | "utils/TableGen", |
| 252 | "tools/clang-check", |
| 253 | "tools/clang-format", |
| 254 | "tools/driver", |
| 255 | "tools/libclang", |
| 256 | ] |