From f5459fc03120a03040c8f2f41d5a28bea79ecf75 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 5 Apr 2023 14:24:34 -0500 Subject: [PATCH] [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 --- llvm/runtimes/CMakeLists.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index b9e1f32..d47a2d5 100644 --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -361,12 +361,11 @@ if(runtimes) # 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)) -- 2.7.4