diff --git a/llvm/utils/gn/secondary/llvm/tools/opt/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/opt/BUILD.gn index 67940c61fe134..b044c928bc885 100644 --- a/llvm/utils/gn/secondary/llvm/tools/opt/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/tools/opt/BUILD.gn @@ -1,4 +1,5 @@ -executable("opt") { +static_library("lib") { + output_name = "LLVMOptDriver" deps = [ "//llvm/include/llvm/Config:llvm-config", "//llvm/lib/Analysis", @@ -23,8 +24,13 @@ executable("opt") { ] sources = [ "NewPMDriver.cpp", - "opt.cpp", + "optdriver.cpp", ] +} + +executable("opt") { + sources = [ "opt.cpp" ] + deps = [ ":lib" ] # Support plugins. # FIXME: Disable dead stripping once other binaries are dead-stripped.