Index: llvm/trunk/utils/gn/secondary/BUILD.gn =================================================================== --- llvm/trunk/utils/gn/secondary/BUILD.gn +++ llvm/trunk/utils/gn/secondary/BUILD.gn @@ -1,5 +1,6 @@ group("default") { deps = [ + "//clang/lib/Driver", "//clang/lib/Parse", "//clang/tools/clang-format", "//lld/test", Index: llvm/trunk/utils/gn/secondary/clang/include/clang/Driver/BUILD.gn =================================================================== --- llvm/trunk/utils/gn/secondary/clang/include/clang/Driver/BUILD.gn +++ llvm/trunk/utils/gn/secondary/clang/include/clang/Driver/BUILD.gn @@ -0,0 +1,5 @@ +import("//llvm/utils/TableGen/tablegen.gni") + +tablegen("Options") { + args = [ "-gen-opt-parser-defs" ] +} Index: llvm/trunk/utils/gn/secondary/clang/include/clang/StaticAnalyzer/Checkers/BUILD.gn =================================================================== --- llvm/trunk/utils/gn/secondary/clang/include/clang/StaticAnalyzer/Checkers/BUILD.gn +++ llvm/trunk/utils/gn/secondary/clang/include/clang/StaticAnalyzer/Checkers/BUILD.gn @@ -0,0 +1,5 @@ +import("//clang/utils/TableGen/clang_tablegen.gni") + +clang_tablegen("Checkers") { + args = [ "-gen-clang-sa-checkers" ] +} Index: llvm/trunk/utils/gn/secondary/clang/lib/Driver/BUILD.gn =================================================================== --- llvm/trunk/utils/gn/secondary/clang/lib/Driver/BUILD.gn +++ llvm/trunk/utils/gn/secondary/clang/lib/Driver/BUILD.gn @@ -0,0 +1,88 @@ +static_library("Driver") { + output_name = "clangDriver" + configs += [ "//llvm/utils/gn/build:clang_code" ] + include_dirs = [ "." ] + deps = [ + "//clang/include/clang/Config", + + # Driver doesn't depend on StaticAnalyzer and the other way round, but + # as of clang r311958 Driver does depend on StaticAnalyzer/Checkers's + # tablegen'd Checkers.inc. The CMake build runs all clang tablegen steps + # before all lib compilations via the clang-tablegen-targets target; the + # GN build has this dependency instead. + # FIXME: Move Checkers.td somewhere else to clean up this layering mess. + # See the review thread of r311958 for details. + "//clang/include/clang/StaticAnalyzer/Checkers", + "//clang/lib/Basic", + "//llvm/include/llvm/Config:llvm-config", + "//llvm/lib/BinaryFormat", + "//llvm/lib/Option", + "//llvm/lib/Support", + ] + public_deps = [ + # public_dep because public header Options.h includes generated Options.inc. + "//clang/include/clang/Driver:Options", + ] + if (host_os == "win") { + # MSVCToolChain.cpp uses version.dll. + libs = [ "version.lib" ] + } + sources = [ + "Action.cpp", + "Compilation.cpp", + "DarwinSDKInfo.cpp", + "Distro.cpp", + "Driver.cpp", + "DriverOptions.cpp", + "Job.cpp", + "Multilib.cpp", + "Phases.cpp", + "SanitizerArgs.cpp", + "Tool.cpp", + "ToolChain.cpp", + "ToolChains/AMDGPU.cpp", + "ToolChains/AVR.cpp", + "ToolChains/Ananas.cpp", + "ToolChains/Arch/AArch64.cpp", + "ToolChains/Arch/ARM.cpp", + "ToolChains/Arch/Mips.cpp", + "ToolChains/Arch/PPC.cpp", + "ToolChains/Arch/RISCV.cpp", + "ToolChains/Arch/Sparc.cpp", + "ToolChains/Arch/SystemZ.cpp", + "ToolChains/Arch/X86.cpp", + "ToolChains/BareMetal.cpp", + "ToolChains/Clang.cpp", + "ToolChains/CloudABI.cpp", + "ToolChains/CommonArgs.cpp", + "ToolChains/Contiki.cpp", + "ToolChains/CrossWindows.cpp", + "ToolChains/Cuda.cpp", + "ToolChains/Darwin.cpp", + "ToolChains/DragonFly.cpp", + "ToolChains/FreeBSD.cpp", + "ToolChains/Fuchsia.cpp", + "ToolChains/Gnu.cpp", + "ToolChains/HIP.cpp", + "ToolChains/Haiku.cpp", + "ToolChains/Hexagon.cpp", + "ToolChains/Hurd.cpp", + "ToolChains/Linux.cpp", + "ToolChains/MSVC.cpp", + "ToolChains/MinGW.cpp", + "ToolChains/Minix.cpp", + "ToolChains/MipsLinux.cpp", + "ToolChains/Myriad.cpp", + "ToolChains/NaCl.cpp", + "ToolChains/NetBSD.cpp", + "ToolChains/OpenBSD.cpp", + "ToolChains/PS4CPU.cpp", + "ToolChains/RISCVToolchain.cpp", + "ToolChains/Solaris.cpp", + "ToolChains/TCE.cpp", + "ToolChains/WebAssembly.cpp", + "ToolChains/XCore.cpp", + "Types.cpp", + "XRayArgs.cpp", + ] +}