[x265] [PATCH] Enabling the option to compile without libNUMA support in Linux

Pradeep Ramachandran pradeep at multicorewareinc.com
Fri Aug 21 15:52:42 CEST 2015


# HG changeset patch
# User Pradeep Ramachandran <pradeep at multicorewareinc.com>
# Date 1440165034 14400
#      Fri Aug 21 09:50:34 2015 -0400
# Node ID 6d01ef92695e6ae663b62715ee24a9f513d529de
# Parent  f63273fa3137fef2f6898c686b68ee12608acd31
Enabling the option to compile without libNUMA support in Linux.

Need to find a good way to do this for Windows builds

diff -r f63273fa3137 -r 6d01ef92695e source/CMakeLists.txt
--- a/source/CMakeLists.txt	Thu Aug 20 11:13:25 2015 +0530
+++ b/source/CMakeLists.txt	Fri Aug 21 09:50:34 2015 -0400
@@ -71,23 +71,27 @@
     if(LIBRT)
         list(APPEND PLATFORM_LIBS rt)
     endif()
+    mark_as_advanced(LIBRT)
     find_library(LIBDL dl)
     if(LIBDL)
         list(APPEND PLATFORM_LIBS dl)
     endif()
-    find_package(Numa)
-    if(NUMA_FOUND)
-        link_directories(${NUMA_LIBRARY_DIR})
-        list(APPEND CMAKE_REQUIRED_LIBRARIES numa)
-        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")
-            list(APPEND PLATFORM_LIBS numa)
-            include_directories(${NUMA_INCLUDE_DIR})
+    option(ENABLE_LIBNUMA "Enable libnuma usage (Linux only)" ON)
+    if(ENABLE_LIBNUMA)
+        find_package(Numa)
+        if(NUMA_FOUND)
+            link_directories(${NUMA_LIBRARY_DIR})
+            list(APPEND CMAKE_REQUIRED_LIBRARIES numa)
+            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")
+                list(APPEND PLATFORM_LIBS numa)
+                include_directories(${NUMA_INCLUDE_DIR})
+            endif()
         endif()
-    endif()
-    mark_as_advanced(LIBRT NUMA_FOUND)
+        mark_as_advanced(NUMA_FOUND)
+    endif(ENABLE_LIBNUMA)
     option(NO_ATOMICS "Use a slow mutex to replace atomics" OFF)
     if(NO_ATOMICS)
         add_definitions(-DNO_ATOMICS=1)


More information about the x265-devel mailing list