Skip to content

Commit 26e2c97

Browse files
mgornytstellar
authored andcommitted
[openmp] [elf_common] Fix linking against LLVM dylib
The hand-rolled linking logic in elf_common does not account for the possibility of using LLVM dylib rather than a dozen static libraries. Since it does not seem to be easily convertible to add_llvm_library, just hand-roll support for LLVM_LINK_LLVM_DYLIB. This is necessary to support stand-alone builds against installed LLVM. Differential Revision: https://reviews.llvm.org/D111038 (cherry picked from commit 0873b9b)
1 parent eb84552 commit 26e2c97

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ add_library(elf_common OBJECT elf_common.cpp)
1616
set_property(TARGET elf_common PROPERTY POSITION_INDEPENDENT_CODE ON)
1717
llvm_update_compile_flags(elf_common)
1818
set(LINK_LLVM_LIBS LLVMBinaryFormat LLVMObject LLVMSupport)
19+
if (LLVM_LINK_LLVM_DYLIB)
20+
set(LINK_LLVM_LIBS LLVM)
21+
endif()
1922
target_link_libraries(elf_common INTERFACE ${LINK_LLVM_LIBS})
2023
include_directories(${LIBOMPTARGET_LLVM_INCLUDE_DIRS})
2124
add_dependencies(elf_common ${LINK_LLVM_LIBS})

0 commit comments

Comments
 (0)