[cmake] Fix dependencies.

* Use CMAKE_DL_LIBS instead of hard-coded `dl`.
* Use Threads::Threads instead of `pthread`.
* Drop `rt` dep.
* Find libdrm via pkgconfig (consistent to how other ROCm projects do it as documented here: https://github.com/ROCm/TheRock/blob/main/docs/development/dependencies.md#libdrm)
Цей коміт міститься в:
Stella Laurenzo authored and Arif, Maisam committed 2025-09-24 20:44:03 -05:00
1 джерело 3c8fd1bf54
коміт 4e6731a817
3 files changed
+18 -2

No files matched your search

+6 -1
Переглянути файл
@@ -78,7 +78,12 @@ set(${AMD_SMI}_VERSION_BUILD "0")
message("SOVERSION: ${SO_VERSION_STRING}")
add_library(${AMD_SMI} ${SRC_LIST} ${INC_LIST})
target_link_libraries(${AMD_SMI} pthread rt dl ${DRM_LIBRARIES} ${AMDGPU_DRM_LIBRARIES})
target_link_libraries(${AMD_SMI} PRIVATE
PkgConfig::DRM
PkgConfig::DRM_AMDGPU
Threads::Threads
${CMAKE_DL_LIBS}
)
target_include_directories(${AMD_SMI} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/rocm_smi/include
${PROJECT_SOURCE_DIR}/common/shared_mutex ${ACA_INC_DIR})