rocr: Search for libnuma with find_package before find_library.
This avoids a false dependence on a system library when not desired.
This commit is contained in:
committed by
Mallya, Ameya Keshava
parent
98a5ebc3f1
commit
c36ccaaf4b
@@ -158,13 +158,20 @@ get_os_info()
|
|||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
# Check for libraries required for building
|
# Check for libraries required for building
|
||||||
find_library(LIBC NAMES c REQUIRED)
|
find_library(LIBC NAMES c REQUIRED)
|
||||||
find_library(NUMA NAMES numa REQUIRED)
|
find_package(NUMA)
|
||||||
message(STATUS "LIBC:" ${LIBC})
|
if(NUMA_FOUND)
|
||||||
message(STATUS "NUMA:" ${NUMA})
|
set(NUMA "${NUMA_LIBRARIES}")
|
||||||
|
else()
|
||||||
|
find_library(NUMA NAMES numa REQUIRED)
|
||||||
|
endif()
|
||||||
|
message(STATUS "LIBC: " ${LIBC})
|
||||||
|
message(STATUS "NUMA: " ${NUMA})
|
||||||
|
|
||||||
## If environment variable DRM_DIR is set, the script
|
## If environment variable DRM_DIR is set, the script
|
||||||
## will pick up the corresponding libraries from that path.
|
## will pick up the corresponding libraries from that path.
|
||||||
list (PREPEND CMAKE_PREFIX_PATH "${DRM_DIR}")
|
if(DRM_DIR)
|
||||||
|
list (PREPEND CMAKE_PREFIX_PATH "${DRM_DIR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
# The module name passed to pkg_check_modules() is determined by the
|
# The module name passed to pkg_check_modules() is determined by the
|
||||||
# name of file *.pc
|
# name of file *.pc
|
||||||
@@ -174,7 +181,7 @@ include_directories(${DRM_AMDGPU_INCLUDE_DIRS})
|
|||||||
include_directories(${DRM_INCLUDE_DIRS})
|
include_directories(${DRM_INCLUDE_DIRS})
|
||||||
|
|
||||||
target_link_libraries ( ${HSAKMT_TARGET}
|
target_link_libraries ( ${HSAKMT_TARGET}
|
||||||
PRIVATE ${DRM_LDFLAGS} ${DRM_AMDGPU_LDFLAGS} pthread rt c numa ${CMAKE_DL_LIBS}
|
PRIVATE ${DRM_LDFLAGS} ${DRM_AMDGPU_LDFLAGS} pthread rt ${LIBC} ${NUMA} ${CMAKE_DL_LIBS}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_options(${HSAKMT_TARGET} PRIVATE ${DRM_CFLAGS} ${HSAKMT_C_FLAGS})
|
target_compile_options(${HSAKMT_TARGET} PRIVATE ${DRM_CFLAGS} ${HSAKMT_C_FLAGS})
|
||||||
|
|||||||
Reference in New Issue
Block a user