Skip to content

Commit 2e4ec3e

Browse files
committed
unittests: Fix build with LLVM_LINK_LLVM_DYLIB=ON
The build system was linking the PluginsTests unittest against libLLVM.so and LLVMAsmParser which was causing the test to fail with this error: LLVM ERROR: inconsistency in registered CommandLine options We need to add llvm libraries to LLVM_LINK_COMPONENTS so that they are dropped from the linker arguments when linking with LLVM_LINK_LLVM_DYLIB=ON Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D105523
1 parent feef171 commit 2e4ec3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/unittests/Passes/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ endif()
1212
# work with DLLs on Windows (where a shared library can't have undefined
1313
# references), so just skip this testcase on Windows.
1414
if (NOT WIN32)
15-
set(LLVM_LINK_COMPONENTS Support Passes Core)
15+
set(LLVM_LINK_COMPONENTS Support Passes Core LLVMAsmParser)
1616
add_llvm_unittest(PluginsTests
1717
PluginsTest.cpp
1818
)
1919
export_executable_symbols_for_plugins(PluginsTests)
20-
target_link_libraries(PluginsTests PRIVATE LLVMAsmParser LLVMTestingSupport)
20+
target_link_libraries(PluginsTests PRIVATE LLVMTestingSupport)
2121

2222
set(LLVM_LINK_COMPONENTS)
2323
foreach(PLUGIN TestPlugin DoublerPlugin)

0 commit comments

Comments
 (0)