Skip to content

[Libomptarget] Fix linking to LLVM dylib #86397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 27 additions & 28 deletions openmp/libomptarget/plugins-nextgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down