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