[Openmp-commits] [openmp] dc049a4 - [OpenMP] Make `libomptarget` link against `libomp`
Shilei Tian via Openmp-commits
openmp-commits at lists.llvm.org
Mon May 1 16:01:49 PDT 2023
Author: Shilei Tian
Date: 2023-05-01T19:01:45-04:00
New Revision: dc049a4ea681b1d0a4880bae3e19ae0ef40f6e80
URL: https://github.com/llvm/llvm-project/commit/dc049a4ea681b1d0a4880bae3e19ae0ef40f6e80
DIFF: https://github.com/llvm/llvm-project/commit/dc049a4ea681b1d0a4880bae3e19ae0ef40f6e80.diff
LOG: [OpenMP] Make `libomptarget` link against `libomp`
In `libomptarget` we use a couple of functions from `libomp`, but we didn't link
`libomptarget` against `libomp`. That will not work on some platforms such
as macOS. A linker error will be encountered because those symbols are not resolved
at link time when building `libomptarget`. This patch simply makes `libomptarget`
link agains `libomp`, makes it a "user" of `libomp`. I think this will not break
the policies between `libomp` and `libomptarget`.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D149617
Added:
Modified:
openmp/libomptarget/src/CMakeLists.txt
Removed:
################################################################################
diff --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
index ef3a6270b78a..ff5d8c4dd558 100644
--- a/openmp/libomptarget/src/CMakeLists.txt
+++ b/openmp/libomptarget/src/CMakeLists.txt
@@ -31,6 +31,10 @@ add_llvm_library(omptarget
Support
Object
+ LINK_LIBS
+ PUBLIC
+ omp
+
NO_INSTALL_RPATH
)
target_include_directories(omptarget PRIVATE ${LIBOMPTARGET_INCLUDE_DIR})
More information about the Openmp-commits
mailing list