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
# together in a single CMake invocation.
set(extra_deps "")
if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
- if(TARGET opt)
- list(APPEND extra_deps opt)
- endif()
- if(TARGET llvm-link)
- list(APPEND extra_deps llvm-link)
- endif()
+ foreach(dep opt llvm-link llvm-extract clang clang-offload-packager)
+ if(TARGET ${dep} AND OPENMP_ENABLE_LIBOMPTARGET)
+ list(APPEND extra_deps ${dep})
+ endif()
+ endforeach()
endif()
if("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND
(LLVM_LIBC_FULL_BUILD OR LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES))