Skip to content

Commit

Permalink
[OpenMP] Make libomptarget link against libomp
Browse files Browse the repository at this point in the history
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
  • Loading branch information
shiltian committed May 1, 2023
1 parent 1e85342 commit dc049a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openmp/libomptarget/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit dc049a4

Please sign in to comment.