[gn build] Add build file for clang/lib/FrontendTool
authorNico Weber <nicolasweber@gmx.de>
Sat, 22 Dec 2018 03:15:56 +0000 (03:15 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 22 Dec 2018 03:15:56 +0000 (03:15 +0000)
Differential Revision: https://reviews.llvm.org/D55980

llvm-svn: 349988

llvm/utils/gn/secondary/BUILD.gn
llvm/utils/gn/secondary/clang/lib/FrontendTool/BUILD.gn [new file with mode: 0644]

index 03c465d..5f946a0 100644 (file)
@@ -8,6 +8,7 @@ group("default") {
     "//clang/lib/Driver",
     "//clang/lib/Frontend",
     "//clang/lib/Frontend/Rewrite",
+    "//clang/lib/FrontendTool",
     "//clang/lib/Index",
     "//clang/lib/Parse",
     "//clang/lib/Serialization",
diff --git a/llvm/utils/gn/secondary/clang/lib/FrontendTool/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/FrontendTool/BUILD.gn
new file mode 100644 (file)
index 0000000..6bcb4c3
--- /dev/null
@@ -0,0 +1,29 @@
+import("//clang/lib/ARCMigrate/enable.gni")
+import("//clang/lib/StaticAnalyzer/Frontend/enable.gni")
+
+assert(clang_enable_static_analyzer || !clang_enable_arcmt,
+       "Cannot disable static analyzer while enabling ARCMT")
+
+static_library("FrontendTool") {
+  output_name = "clangFrontendTool"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang/include/clang/Config",
+    "//clang/lib/Basic",
+    "//clang/lib/CodeGen",
+    "//clang/lib/Driver",
+    "//clang/lib/Frontend",
+    "//clang/lib/Frontend/Rewrite",
+    "//llvm/lib/Option",
+    "//llvm/lib/Support",
+  ]
+  if (clang_enable_arcmt) {
+    deps += [ "//clang/lib/ARCMigrate" ]
+  }
+  if (clang_enable_static_analyzer) {
+    deps += [ "//clang/lib/StaticAnalyzer/Frontend" ]
+  }
+  sources = [
+    "ExecuteCompilerInvocation.cpp",
+  ]
+}