
Building with -DLLVM_ENABLE_EXPORTED_SYMBOLS_IN_EXECUTABLES=Off should not prevent use of opt plugins. This fix uses the approach implemented in https://github.com/llvm/llvm-project/pull/101741. rdar://135841478
54 lines
786 B
CMake
54 lines
786 B
CMake
set(LLVM_LINK_COMPONENTS
|
|
AllTargetsAsmParsers
|
|
AllTargetsCodeGens
|
|
AllTargetsDescs
|
|
AllTargetsInfos
|
|
AggressiveInstCombine
|
|
Analysis
|
|
AsmParser
|
|
BitWriter
|
|
CFGuard
|
|
CodeGen
|
|
Core
|
|
Coroutines
|
|
Extensions
|
|
IPO
|
|
IRReader
|
|
IRPrinter
|
|
InstCombine
|
|
Instrumentation
|
|
MC
|
|
ObjCARCOpts
|
|
Remarks
|
|
ScalarOpts
|
|
Support
|
|
Target
|
|
TargetParser
|
|
TransformUtils
|
|
Vectorize
|
|
Passes
|
|
)
|
|
|
|
# We don't want to link this into libLLVM
|
|
add_llvm_library(LLVMOptDriver
|
|
STATIC
|
|
NewPMDriver.cpp
|
|
optdriver.cpp
|
|
PARTIAL_SOURCES_INTENDED
|
|
DEPENDS
|
|
intrinsics_gen
|
|
)
|
|
|
|
add_llvm_tool(opt
|
|
PARTIAL_SOURCES_INTENDED
|
|
opt.cpp
|
|
DEPENDS
|
|
intrinsics_gen
|
|
SUPPORT_PLUGINS
|
|
|
|
EXPORT_SYMBOLS
|
|
)
|
|
target_link_libraries(opt PRIVATE LLVMOptDriver)
|
|
|
|
setup_host_tool(opt OPT opt_exe opt_target)
|