[llvm] bacb56c - [gn build] (manually) port cd2292ef824 (PseudoCXX)

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 01:45:42 PDT 2022


Author: Nico Weber
Date: 2022-07-01T10:45:35+02:00
New Revision: bacb56cdc593e054db33c4aecb57cbbe9c20f4d6

URL: https://github.com/llvm/llvm-project/commit/bacb56cdc593e054db33c4aecb57cbbe9c20f4d6
DIFF: https://github.com/llvm/llvm-project/commit/bacb56cdc593e054db33c4aecb57cbbe9c20f4d6.diff

LOG: [gn build] (manually) port cd2292ef824 (PseudoCXX)

This target will be used in the next commit.

Added: 
    llvm/utils/gn/secondary/clang-tools-extra/pseudo/include/BUILD.gn
    llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cxx/BUILD.gn

Modified: 
    

Removed: 
    llvm/utils/gn/secondary/clang-tools-extra/pseudo/cxx/BUILD.gn


################################################################################
diff  --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/cxx/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/cxx/BUILD.gn
deleted file mode 100644
index c2a8d61ad5fc2..0000000000000
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/cxx/BUILD.gn
+++ /dev/null
@@ -1,7 +0,0 @@
-# FIXME: Nothing depends on this yet.
-static_library("cxx") {
-  output_name = "clangPseudoCXX"
-  configs += [ "//llvm/utils/gn/build:clang_code" ]
-  deps = [ "//clang-tools-extra/pseudo/lib/grammar" ]
-  sources = [ "CXX.cpp" ]
-}

diff  --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/include/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/include/BUILD.gn
new file mode 100644
index 0000000000000..8a8625533ec02
--- /dev/null
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/include/BUILD.gn
@@ -0,0 +1,39 @@
+import("//llvm/utils/gn/build/compiled_action.gni")
+
+template("gen") {
+  compiled_action(target_name) {
+    tool = "//clang-tools-extra/pseudo/gen:clang-pseudo-gen"
+    inputs = [ "../lib/cxx/cxx.bnf" ]
+    outputs = [ "$target_gen_dir/$target_name" ]
+    args = [
+      "--grammar",
+      rebase_path(inputs[0], root_build_dir),
+      "-o",
+      rebase_path(outputs[0], root_build_dir),
+      invoker.flag,
+    ]
+  }
+}
+
+gen("CXXSymbols.inc") {
+  flag = "--emit-symbol-list"
+}
+
+gen("CXXBNF.inc") {
+  flag = "--emit-grammar-content"
+}
+
+config("cxx_gen_config") {
+  visibility = [ ":cxx_gen" ]
+  include_dirs = [ target_gen_dir ]
+}
+
+group("cxx_gen") {
+  deps = [
+    ":CXXSymbols.inc",
+    ":CXXBNF.inc",
+  ]
+
+  # Let targets depending on this find the generated files.
+  public_configs = [ ":cxx_gen_config" ]
+}

diff  --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cxx/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cxx/BUILD.gn
new file mode 100644
index 0000000000000..3db60e29bc7a8
--- /dev/null
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cxx/BUILD.gn
@@ -0,0 +1,13 @@
+static_library("cxx") {
+  output_name = "clangPseudoCXX"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang-tools-extra/pseudo/lib/grammar",
+    "//llvm/lib/Support",
+  ]
+
+  # public_deps because this target's public headers include generated headers.
+  public_deps = [ "//clang-tools-extra/pseudo/include:cxx_gen" ]
+  include_dirs = [ "../../include" ]
+  sources = [ "CXX.cpp" ]
+}


        


More information about the llvm-commits mailing list