[gn build] Add build file for clang/lib/Parse

Nothing really interesting. One thing to consider is where the clang_tablegen()
invocations that generate files that are private to a library should be. The
CMake build puts them in clang/include/clang/Parse (in this case), but maybe
putting them right in clang/lib/Parse/BUILD.gn makes mor sense. (For
clang_tablegen() calls that generate .inc files used by the public headers,
putting the call in the public BUILD file makes sense.)

For now, I've put the build file in the public header folder, since that
matches CMake and what I did in the last 2 clang patches, but I'm not sure I
like this.

Differential Revision: https://reviews.llvm.org/D55925

llvm-svn: 349831
This commit is contained in:
Nico Weber 2018-12-20 21:53:05 +00:00
parent 29ea6035be
commit 6efc64959c
3 changed files with 52 additions and 0 deletions

View File

@ -1,5 +1,6 @@
group("default") {
deps = [
"//clang/lib/Parse",
"//clang/tools/clang-format",
"//lld/test",
"//llvm/tools/llvm-undname",

View File

@ -0,0 +1,19 @@
import("//clang/utils/TableGen/clang_tablegen.gni")
clang_tablegen("AttrParserStringSwitches") {
args = [
"-gen-clang-attr-parser-string-switches",
"-I",
rebase_path("../..", root_out_dir),
]
td_file = "../Basic/Attr.td"
}
clang_tablegen("AttrSubMatchRulesParserStringSwitches") {
args = [
"-gen-clang-attr-subject-match-rules-parser-string-switches",
"-I",
rebase_path("../..", root_out_dir),
]
td_file = "../Basic/Attr.td"
}

View File

@ -0,0 +1,32 @@
static_library("Parse") {
output_name = "clangParse"
configs += [ "//llvm/utils/gn/build:clang_code" ]
deps = [
"//clang/include/clang/Parse:AttrParserStringSwitches",
"//clang/include/clang/Parse:AttrSubMatchRulesParserStringSwitches",
"//clang/lib/AST",
"//clang/lib/Basic",
"//clang/lib/Lex",
"//clang/lib/Sema",
"//llvm/lib/MC",
"//llvm/lib/MC/MCParser",
"//llvm/lib/Support",
]
sources = [
"ParseAST.cpp",
"ParseCXXInlineMethods.cpp",
"ParseDecl.cpp",
"ParseDeclCXX.cpp",
"ParseExpr.cpp",
"ParseExprCXX.cpp",
"ParseInit.cpp",
"ParseObjc.cpp",
"ParseOpenMP.cpp",
"ParsePragma.cpp",
"ParseStmt.cpp",
"ParseStmtAsm.cpp",
"ParseTemplate.cpp",
"ParseTentative.cpp",
"Parser.cpp",
]
}