[OpenMP] Fix incorrect CUDA bc path after library change (#157547)
diff --git a/offload/test/lit.cfg b/offload/test/lit.cfg
index f3e8e9a..a41bcb9 100644
--- a/offload/test/lit.cfg
+++ b/offload/test/lit.cfg
@@ -169,7 +169,7 @@
if config.cuda_libdir:
config.test_flags += " -Wl,-rpath," + config.cuda_libdir
if config.libomptarget_current_target.startswith('nvptx'):
- config.test_flags_clang += " --libomptarget-nvptx-bc-path=" + config.llvm_library_intdir
+ config.test_flags_clang += " --libomptarget-nvptx-bc-path=" + config.llvm_library_intdir + "/nvptx64-nvidia-cuda"
if config.libomptarget_current_target.endswith('-LTO'):
config.test_flags += " -foffload-lto"
if config.libomptarget_current_target.endswith('-JIT-LTO') and evaluate_bool_env(
diff --git a/openmp/device/CMakeLists.txt b/openmp/device/CMakeLists.txt
index 59e307d..ded961a 100644
--- a/openmp/device/CMakeLists.txt
+++ b/openmp/device/CMakeLists.txt
@@ -57,7 +57,7 @@
# Trick to combine these into a bitcode file via the linker's LTO pass.
add_executable(libompdevice ${src_files})
set_target_properties(libompdevice PROPERTIES
- RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ RUNTIME_OUTPUT_DIRECTORY "${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}"
LINKER_LANGUAGE CXX
BUILD_RPATH ""
INSTALL_RPATH ""
@@ -85,7 +85,7 @@
add_library(ompdevice.all_objs OBJECT IMPORTED)
set_property(TARGET ompdevice.all_objs APPEND PROPERTY IMPORTED_OBJECTS
- ${CMAKE_CURRENT_BINARY_DIR}/libomptarget-${target_name}.bc)
+ ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/libomptarget-${target_name}.bc)
# Archive all the object files generated above into a static library
add_library(ompdevice STATIC)