From: Nico Weber Date: Wed, 25 May 2022 12:39:29 +0000 (-0400) Subject: [gn build] (manually) port cd2292ef824 (PseudoCXX) X-Git-Tag: upstream/15.0.7~2902 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bacb56cdc593e054db33c4aecb57cbbe9c20f4d6;p=platform%2Fupstream%2Fllvm.git [gn build] (manually) port cd2292ef824 (PseudoCXX) This target will be used in the next commit. --- 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 c2a8d61..0000000 --- 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 0000000..8a86255 --- /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 0000000..3db60e2 --- /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" ] +}