aboutsummaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-03-23 16:46:32 +0100
committerGitHub <noreply@github.com>2024-03-23 15:46:32 +0000
commit3f5e649ff64a92a732027ef76e33a1c8b1722d84 (patch)
tree70e8eaf213557d421c82c562673a3f17212013ae /openmp
parentb68e2eba0bc8dd70b88f4271831139ee9b6ed25c (diff)
downloadllvm-3f5e649ff64a92a732027ef76e33a1c8b1722d84.zip
llvm-3f5e649ff64a92a732027ef76e33a1c8b1722d84.tar.gz
llvm-3f5e649ff64a92a732027ef76e33a1c8b1722d84.tar.bz2
[Libomptarget] Fix linking to LLVM dylib (#86397)
Use `LINK_COMPONENTS` parameter of `add_llvm_library` rather than passing LLVM components directly to `target_link_libraries`, in order to ensure that LLVM dylib is linked correctly when used. Otherwise, CMake insists on linking to static libraries that aren't present on distributions doing pure dylib installs, such as Gentoo. This fixes a regression introduced in dcbddc25250158469c5635ad2ae4095faef53dfd.
Diffstat (limited to 'openmp')
-rw-r--r--openmp/libomptarget/plugins-nextgen/CMakeLists.txt55
1 files changed, 27 insertions, 28 deletions
diff --git a/openmp/libomptarget/plugins-nextgen/CMakeLists.txt b/openmp/libomptarget/plugins-nextgen/CMakeLists.txt
index c19fd80..dbd82ac 100644
--- a/openmp/libomptarget/plugins-nextgen/CMakeLists.txt
+++ b/openmp/libomptarget/plugins-nextgen/CMakeLists.txt
@@ -14,41 +14,40 @@
set(common_dir ${CMAKE_CURRENT_SOURCE_DIR}/common)
add_subdirectory(common)
function(add_target_library target_name lib_name)
- llvm_map_components_to_libnames(llvm_libs
- ${LLVM_TARGETS_TO_BUILD}
- AggressiveInstCombine
- Analysis
- BinaryFormat
- BitReader
- BitWriter
- CodeGen
- Core
- Extensions
- InstCombine
- Instrumentation
- IPO
- IRReader
- Linker
- MC
- Object
- Passes
- Remarks
- ScalarOpts
- Support
- Target
- TargetParser
- TransformUtils
- Vectorize
- )
-
add_llvm_library(${target_name} SHARED
+ LINK_COMPONENTS
+ ${LLVM_TARGETS_TO_BUILD}
+ AggressiveInstCombine
+ Analysis
+ BinaryFormat
+ BitReader
+ BitWriter
+ CodeGen
+ Core
+ Extensions
+ InstCombine
+ Instrumentation
+ IPO
+ IRReader
+ Linker
+ MC
+ Object
+ Passes
+ Remarks
+ ScalarOpts
+ Support
+ Target
+ TargetParser
+ TransformUtils
+ Vectorize
+
NO_INSTALL_RPATH
BUILDTREE_ONLY
)
llvm_update_compile_flags(${target_name})
target_link_libraries(${target_name} PRIVATE
- PluginCommon ${llvm_libs} ${OPENMP_PTHREAD_LIB})
+ PluginCommon ${OPENMP_PTHREAD_LIB})
target_compile_definitions(${target_name} PRIVATE TARGET_NAME=${lib_name})
target_compile_definitions(${target_name} PRIVATE