nixpkgs-23.11-llvm/llvm/14/openmp/gnu-install-dirs.patch

46 lines
2.1 KiB
Diff
Raw Permalink Normal View History

2024-05-22 14:55:29 +08:00
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,7 @@ if (OPENMP_STANDALONE_BUILD)
set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
"Suffix of lib installation directory, e.g. 64 => lib64")
# Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}")
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}")
# Group test settings.
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
@@ -35,7 +35,7 @@ if (OPENMP_STANDALONE_BUILD)
else()
set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
# If building in tree, we honor the same install suffix LLVM uses.
- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
if (NOT MSVC)
set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
diff --git a/libomptarget/plugins/amdgpu/CMakeLists.txt b/libomptarget/plugins/amdgpu/CMakeLists.txt
--- a/libomptarget/plugins/amdgpu/CMakeLists.txt
+++ b/libomptarget/plugins/amdgpu/CMakeLists.txt
@@ -74,7 +74,7 @@ add_library(omptarget.rtl.amdgpu SHARED
# Install plugin under the lib destination folder.
# When we build for debug, OPENMP_LIBDIR_SUFFIX get set to -debug
-install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION "lib${OPENMP_LIBDIR_SUFFIX}")
+install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}")
set_property(TARGET omptarget.rtl.amdgpu PROPERTY INSTALL_RPATH_USE_LINK_PATH ON)
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
diff --git a/libomptarget/plugins/ve/CMakeLists.txt b/libomptarget/plugins/ve/CMakeLists.txt
--- a/libomptarget/plugins/ve/CMakeLists.txt
+++ b/libomptarget/plugins/ve/CMakeLists.txt
@@ -32,7 +32,7 @@ if(${LIBOMPTARGET_DEP_VEO_FOUND})
# Install plugin under the lib destination folder.
install(TARGETS "omptarget.rtl.${tmachine_libname}"
- LIBRARY DESTINATION lib${OPENMP_LIBDIR_SUFFIX})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX})
target_link_libraries(
"omptarget.rtl.${tmachine_libname}"