DEPENDS
GSYMUtilOptsTableGen
+
+ GENERATE_DRIVER
)
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
+#include "llvm/Support/LLVMDriver.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PrettyStackTrace.h"
OS << "\n";
}
-int main(int argc, char **argv) {
+int llvm_gsymutil_main(int argc, char **argv, const llvm::ToolContext &) {
// Print a stack trace if we signal out.
sys::PrintStackTraceOnErrorSignal(argv[0]);
PrettyStackTraceProgram X(argc, argv);
import("//llvm/utils/TableGen/tablegen.gni")
+import("//llvm/utils/gn/build/driver_executable.gni")
tablegen("Opts") {
visibility = [ ":llvm-gsymutil" ]
args = [ "-gen-opt-parser-defs" ]
}
-executable("llvm-gsymutil") {
+driver_executable("llvm-gsymutil") {
deps = [
":Opts",
"//llvm/lib/DebugInfo/DWARF",
td_srcs = ["include/llvm/Option/OptParser.td"],
)
+expand_template(
+ name = "gsymutil_main",
+ out = "llvm-gsymutil-driver.cpp",
+ substitutions = {
+ "@TOOL_NAME@": "llvm_gsymutil",
+ },
+ template = "cmake/modules/llvm-driver-template.cpp.in",
+)
+
cc_binary(
name = "llvm-gsymutil",
srcs = glob([
"tools/llvm-gsymutil/*.cpp",
"tools/llvm-gsymutil/*.h",
- ]),
+ ]) + ["llvm-gsymutil-driver.cpp"],
copts = llvm_copts,
stamp = 0,
deps = [