Skip to content

Commit f5459fc

Browse files
committed
[OpenMP] Add tool dependencies in runtimes mode
The OpenMP offloading device runtime depends on multiple tools. We should ensure that these tools are build before invoking the OpenMP build. Reviewed By: tra Differential Revision: https://reviews.llvm.org/D147654
1 parent 9f5c6dc commit f5459fc

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/runtimes/CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,11 @@ if(runtimes)
361361
# together in a single CMake invocation.
362362
set(extra_deps "")
363363
if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
364-
if(TARGET opt)
365-
list(APPEND extra_deps opt)
366-
endif()
367-
if(TARGET llvm-link)
368-
list(APPEND extra_deps llvm-link)
369-
endif()
364+
foreach(dep opt llvm-link llvm-extract clang clang-offload-packager)
365+
if(TARGET ${dep} AND OPENMP_ENABLE_LIBOMPTARGET)
366+
list(APPEND extra_deps ${dep})
367+
endif()
368+
endforeach()
370369
endif()
371370
if("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND
372371
(LLVM_LIBC_FULL_BUILD OR LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES))

0 commit comments

Comments
 (0)