Skip to content

Commit

Permalink
[Offload] Fix per-target install directory (llvm#89645)
Browse files Browse the repository at this point in the history
Summary:
The move from `openmp` to `offload` did not preserve the per-target
runtime directory installation. This is important because this
per-target directory is always included first and is likely the de-facto
way to handle these going forward. Without this installation, old
installations of the library will be linked against first.
  • Loading branch information
jhuber6 authored Apr 22, 2024
1 parent 6b1b4c1 commit a6f1b3a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions offload/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,21 @@ if (OPENMP_ENABLE_LIBOMPTARGET)
endif()
endif()

# TODO: Leftover from the move, could probably be just LLVM_LIBDIR_SUFFIX everywhere.
set(OFFLOAD_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
if(OPENMP_STANDALONE_BUILD)
set(OFFLOAD_LIBDIR_SUFFIX "" CACHE STRING
"Suffix of lib installation directory, e.g. 64 => lib64")
set(OFFLOAD_INSTALL_LIBDIR "lib${OFFLOAD_LIBDIR_SUFFIX}" CACHE STRING
"Path where built offload libraries should be installed.")
else()
# When building in tree we install the runtime according to the LLVM settings.
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
set(OFFLOAD_INSTALL_LIBDIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE STRING
"Path where built offload libraries should be installed.")
else()
set(OFFLOAD_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}" CACHE STRING
"Path where built offload libraries should be installed.")
endif()
endif()

set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)

Expand Down

0 comments on commit a6f1b3a

Please sign in to comment.