[offload] Fix finding libomptarget in runtimes build (#157856)

Per the logic in top-level CMakeLists, `libomptarget` is placed into
`LLVM_LIBRARY_OUTPUT_INTDIR` when this variable is set. Adjust the test
logic to include this directory in `-L` and `-Wl,-rpath` arguments as
well, in order to fix finding tests when building via the `runtimes`
top-level directory.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2025-09-10 16:31:22 +02:00
committed by GitHub
parent d070960319
commit 312b5615df

View File

@@ -83,6 +83,7 @@ config.test_format = lit.formats.ShTest()
config.test_flags = " -I " + config.test_source_root + \
" -I " + config.omp_header_directory + \
" -L " + config.library_dir + \
" -L " + config.llvm_library_intdir + \
" -L " + config.llvm_lib_directory
# compiler specific flags
@@ -165,6 +166,7 @@ else: # Unices
config.test_flags += " -nogpulib"
config.test_flags += " -Wl,-rpath," + config.library_dir
config.test_flags += " -Wl,-rpath," + config.omp_host_rtl_directory
config.test_flags += " -Wl,-rpath," + config.llvm_library_intdir
config.test_flags += " -Wl,-rpath," + config.llvm_lib_directory
if config.cuda_libdir:
config.test_flags += " -Wl,-rpath," + config.cuda_libdir