Skip to content

Commit dc049a4

Browse files
committed
[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
1 parent 1e85342 commit dc049a4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

openmp/libomptarget/src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ add_llvm_library(omptarget
3131
Support
3232
Object
3333

34+
LINK_LIBS
35+
PUBLIC
36+
omp
37+
3438
NO_INSTALL_RPATH
3539
)
3640
target_include_directories(omptarget PRIVATE ${LIBOMPTARGET_INCLUDE_DIR})

0 commit comments

Comments
 (0)