From e4654b99e162defbe6bbef94213b63e04a58ea77 Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Fri, 29 Oct 2021 08:09:21 -0400 Subject: [PATCH] CMakeLists: Refer to libdrm-amdgpu1 for RPM distros The infra is in place to make sure that we can get around the issue where older versions of rpm don't know what "Suggests" is. Using the HSAKMT_REQUIRES_LIBDRM variable will force the package to require libdrm-amdgpu1 instead of just suggesting it in newer distros. Change-Id: I5d595c4e4be5ad8e8c411dcec3a58365e1984f05 [ROCm/ROCR-Runtime commit: 7e90eef254d38c7c9d0ab5bbc1b448563cff27f6] --- projects/rocr-runtime/CMakeLists.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/projects/rocr-runtime/CMakeLists.txt b/projects/rocr-runtime/CMakeLists.txt index db28804314..6f6bdfd68c 100644 --- a/projects/rocr-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/CMakeLists.txt @@ -355,17 +355,16 @@ set(CPACK_DEBIAN_PACKAGE_REPLACES "hsakmt-roct") set(CPACK_RPM_PACKAGE_REQUIRES "libdrm-devel, rocm-core") -# TODO: Implement this effectively # NOTE: CentOS/RHEL <8 and SUSE <10 have no concept of "Suggests" # so a "suggests" field will just cause rpm installation to fail # If the HSAKMT_REQUIRES_LIBDRM variable is true in the build # environment, we use REQUIRES. Otherwise we use SUGGESTS # For the distros above, this variable should be set to true -#if(DEFINED HSAKMT_REQUIRES_LIBDRM) -# string ( APPEND CPACK_RPM_PACKAGE_REQUIRES ", libdrm-amdgpu" ) -#else() -# set(CPACK_RPM_PACKAGE_SUGGESTS "libdrm-amdgpu" ) -#endif() +if(DEFINED HSAKMT_REQUIRES_LIBDRM) + string ( APPEND CPACK_RPM_PACKAGE_REQUIRES ", libdrm-amdgpu" ) +else() + set(CPACK_RPM_PACKAGE_SUGGESTS "libdrm-amdgpu" ) +endif() # Set the names now using CPACK utility set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")