Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions projects/rocr-runtime/libhsakmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,16 @@ else()
find_package(NUMA)
if(NUMA_FOUND)
set(NUMA "${NUMA_LIBRARIES}")
# In BUILD_SHARED_LIBS mode hsakmt-config.cmake loads hsakmtTargets.cmake.
# Because hsakmt is static, its private imported dependencies are exported
# through LINK_ONLY and must be recreated by the package config. The
# staticdrm package path links the raw library name instead.
if(BUILD_SHARED_LIBS)
foreach(_numa_library IN LISTS NUMA_LIBRARIES)
if(TARGET "${_numa_library}")
set(HSAKMT_FIND_NUMA_DEPENDENCY ON)
break()
endif()
endforeach()
endif()
# When NUMA was found as a target, ensure consumers can find it too
# by having hsakmt-config.cmake call find_dependency(NUMA).
# This is needed regardless of BUILD_SHARED_LIBS because hsakmt's
# exported targets reference numa::numa.
foreach(_numa_library IN LISTS NUMA_LIBRARIES)
if(TARGET "${_numa_library}")
set(HSAKMT_FIND_NUMA_DEPENDENCY ON)
break()
endif()
endforeach()
else()
find_library(NUMA NAMES numa REQUIRED)
endif()
Expand Down
3 changes: 2 additions & 1 deletion projects/rocr-runtime/libhsakmt/hsakmt-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ include( CMakeFindDependencyMacro )
if(@HSAKMT_FIND_NUMA_DEPENDENCY@)
# A ROCm distribution that bundles libnuma installs its package config under
# lib/rocm_sysdeps, which is not on a consumer's default search path.
find_dependency(NUMA PATHS "${PACKAGE_PREFIX_DIR}/lib/rocm_sysdeps")
# Force CONFIG mode to ensure the imported target (numa::numa) is created.
find_dependency(NUMA CONFIG PATHS "${PACKAGE_PREFIX_DIR}/lib/rocm_sysdeps")
endif()

# If the option is ON link other dependent libraries dynamically
Expand Down
Loading