Skip to content

Commit e8cf175

Browse files
authored
[runtimes] Fix OpenMP dependencies (#85977)
When building the OpenMP runtime with libomptarget support, the runtimes configure step needs to have a dependency on various tools, in particular opt, so that cmake configure checks yield the correct results. This did not work correctly, as the dependencies were only added if the OPENMP_ENABLE_LIBOMPTARGET was set - but that variable is only set by the openmp/CMakeLists.txt file, which isn't even parsed during the initial cmake run (in fact, it is only parsed when executing the runtimes configure step itself, but then it is too late). Fixed by just adding those dependencies always. In addition, the list of dependencies collected in ${extra_deps}, including those required for OpenMP, was only actually used when configuring runtimes for the default set of targets - when the user specifies a non-default LLVM_RUNTIME_TARGETS, those extra dependencies were ignored (with the exception of ${hdrgen_deps}). Fixed by passing the full ${extra_deps} in this case as well. Fixes: #85933
1 parent cb07194 commit e8cf175

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/runtimes/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ if(runtimes)
435435
list(APPEND extra_deps "flang-new")
436436
endif()
437437
foreach(dep opt llvm-link llvm-extract clang clang-offload-packager)
438-
if(TARGET ${dep} AND OPENMP_ENABLE_LIBOMPTARGET)
438+
if(TARGET ${dep})
439439
list(APPEND extra_deps ${dep})
440440
endif()
441441
endforeach()
@@ -531,7 +531,7 @@ if(runtimes)
531531
check_apple_target(${name} runtime)
532532

533533
runtime_register_target(${name}
534-
DEPENDS ${builtins_dep_name} ${hdrgen_deps}
534+
DEPENDS ${builtins_dep_name} ${extra_deps}
535535
CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${name} ${libc_cmake_args}
536536
EXTRA_ARGS TARGET_TRIPLE ${name})
537537
endforeach()

0 commit comments

Comments
 (0)