changeset 9599:6a9cff19ca93

cmake: ignore older versions of libnuma
author Steve Borho <steve@borho.org>
date Mon, 02 Mar 2015 10:04:37 -0600
parents 018e8bbaa854
children 788f5768b107
files source/CMakeLists.txt
diffstat 1 files changed, 9 insertions(+-), 5 deletions(-) [+]
line wrap: on
line diff
--- a/source/CMakeLists.txt	Fri Feb 27 11:46:09 2015 +0530
+++ b/source/CMakeLists.txt	Mon Mar 02 10:04:37 2015 -0600
@@ -58,11 +58,15 @@ if(UNIX)
     endif()
     find_package(Numa)
     if(NUMA_FOUND)
-        add_definitions(-DHAVE_LIBNUMA)
-        message(STATUS "libnuma found, building with support for NUMA nodes")
-        set(PLATFORM_LIBS ${PLATFORM_LIBS} ${NUMA_LIBRARY})
-        link_directories(${NUMA_LIBRARY_DIR})
-        include_directories(${NUMA_INCLUDE_DIR})
+        list(APPEND CMAKE_REQUIRED_LIBRARIES ${NUMA_LIBRARY})
+        check_symbol_exists(numa_node_of_cpu numa.h NUMA_V2)
+        if(NUMA_V2)
+            add_definitions(-DHAVE_LIBNUMA)
+            message(STATUS "libnuma found, building with support for NUMA nodes")
+            set(PLATFORM_LIBS ${PLATFORM_LIBS} ${NUMA_LIBRARY})
+            link_directories(${NUMA_LIBRARY_DIR})
+            include_directories(${NUMA_INCLUDE_DIR})
+        endif()
     endif()
     mark_as_advanced(LIBRT NUMA_FOUND)
 endif(UNIX)