Skip to content

Commit 369cbcc

Browse files
authored
[lldb] include LLVMTargetParser in LINK_COMPONENTS (#145606)
## Purpose Fix duplicate symbol definition errors when building LLDB `HostTests` against a LLVM Windows DLL. ## Background When building LLDB `HostTests` against LLVM built as a Windows DLL, compilation fails due to multiple duplicate symbol definition errors. This is because symbols are both exported by the LLVM Windows DLL and the `LLVMTargetParser` library. ## Overview The issue is resolved by adding `LLVMTargetParser` (e.g. `TargetParser`) to `LINK_COMPONENTS`, which adds it to `LLVM_LINK_COMPONENTS`, rather than `LINK_LIBS`, which links directly against the library. This change makes it behave correctly when linking against a static or dynamic LLVM.
1 parent 626be98 commit 369cbcc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lldb/unittests/Host/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ add_lldb_unittest(HostTests
3737
lldbUtilityHelpers
3838
lldbHostHelpers
3939
LLVMTestingSupport
40-
LLVMTargetParser
40+
41+
LINK_COMPONENTS
42+
TargetParser
4143
)
4244

4345
add_subdirectory(common)

0 commit comments

Comments
 (0)