diff --git a/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt b/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt --- a/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt +++ b/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt @@ -16,6 +16,9 @@ set_property(TARGET elf_common PROPERTY POSITION_INDEPENDENT_CODE ON) llvm_update_compile_flags(elf_common) set(LINK_LLVM_LIBS LLVMBinaryFormat LLVMObject LLVMSupport) +if (LLVM_LINK_LLVM_DYLIB) + set(LINK_LLVM_LIBS LLVM) +endif() target_link_libraries(elf_common INTERFACE ${LINK_LLVM_LIBS}) include_directories(${LIBOMPTARGET_LLVM_INCLUDE_DIRS}) add_dependencies(elf_common ${LINK_LLVM_LIBS})