[Offload] Enable multilib building for OpenMP/Offload (#188485)

Summary:
Right now the CMake does not follow the pattern other runtime projects
use. All this does is use the standard subdir to place libraries in a
unique location. This allows, for example, users to configure a debug
version of openmp / offload within the same CMake invocation.

---------

Co-authored-by: Michael Kruse <github@meinersbur.de>
This commit is contained in:
Joseph Huber 2026-03-26 07:37:22 -05:00 committed by GitHub
parent a2e0b6a265
commit 82530154ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View file

@ -24,7 +24,12 @@ set(OFFLOAD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# 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
set(OFFLOAD_TARGET_SUBDIR "${LLVM_DEFAULT_TARGET_TRIPLE}")
if(OFFLOAD_LIBDIR_SUBDIR)
string(APPEND OFFLOAD_TARGET_SUBDIR "/${OFFLOAD_LIBDIR_SUBDIR}")
endif()
cmake_path(NORMAL_PATH OFFLOAD_TARGET_SUBDIR)
set(OFFLOAD_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}/${OFFLOAD_TARGET_SUBDIR}" CACHE STRING
"Path where built offload libraries should be installed.")
else()
set(OFFLOAD_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}" CACHE STRING

View file

@ -36,7 +36,12 @@ set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
# When building in tree we install the runtime according to the LLVM settings.
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
set(OPENMP_INSTALL_LIBDIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE STRING
set(OPENMP_TARGET_SUBDIR "${LLVM_DEFAULT_TARGET_TRIPLE}")
if(OPENMP_LIBDIR_SUBDIR)
string(APPEND OPENMP_TARGET_SUBDIR "/${OPENMP_LIBDIR_SUBDIR}")
endif()
cmake_path(NORMAL_PATH OPENMP_TARGET_SUBDIR)
set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}/${OPENMP_TARGET_SUBDIR}" CACHE STRING
"Path where built openmp libraries should be installed.")
else()
set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}" CACHE STRING