Skip to content

Commit 1322aa0

Browse files
committed
Support LLVM_BUILD_LLVM_DYLIB
When built with `LLVM_BUILD_LLVM_DYLIB=On` LLVM will link all components into a monolithic `libLLVM.so`, exported as the shared library target `LLVM` in CMake. Support this configuration of LLVM by looking for the `LLVM_LINK_LLVM_DYLIB` variable exported by the LLVM CMake. Assume the user has not limited the set of components linked into this DSO using e.g. `LLVM_DYLIB_COMPONENTS`, in which case we may fail at static link time. Change-Id: I2d94349bb8af418c4938ccb76471f6e28f9836e5
1 parent 0fb6721 commit 1322aa0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

amd/comgr/CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,14 @@ set(LLD_LIBS
213213
lldELF
214214
lldCommon)
215215

216-
llvm_map_components_to_libnames(LLVM_LIBS
217-
${LLVM_TARGETS_TO_BUILD}
218-
DebugInfoDWARF
219-
Symbolize)
216+
if (LLVM_LINK_LLVM_DYLIB)
217+
set(LLVM_LIBS LLVM)
218+
else()
219+
llvm_map_components_to_libnames(LLVM_LIBS
220+
${LLVM_TARGETS_TO_BUILD}
221+
DebugInfoDWARF
222+
Symbolize)
223+
endif()
220224

221225
target_link_libraries(amd_comgr
222226
PUBLIC

0 commit comments

Comments
 (0)