use system cpu_features package
authorA. Maitland Bottoms <bottoms@debian.org>
Fri, 22 Oct 2021 03:30:05 +0000 (04:30 +0100)
committerA. Maitland Bottoms <bottoms@debian.org>
Fri, 22 Oct 2021 03:30:05 +0000 (04:30 +0100)
Author: Shengjing Zhu <zhsj@debian.org>
Last-Update: 2020-12-26

Gbp-Pq: Name use-system-cpu-features-package.patch

CMakeLists.txt
lib/CMakeLists.txt

index 34eb2041f7fa5f991de1a9b3dbdc548977c31415..c137a3fa4981d8063067332845eec371d8a96dfb 100644 (file)
@@ -142,17 +142,7 @@ else()
   option(VOLK_CPU_FEATURES "Volk uses cpu_features" OFF)
 endif()
 if (VOLK_CPU_FEATURES)
-  if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cpu_features/CMakeLists.txt" )
-    message(FATAL_ERROR "cpu_features/CMakeLists.txt not found. Did you forget to git clone recursively?\nFix with: git submodule update --init")
-  endif()
-  message(STATUS "Building Volk with cpu_features")
-  set(BUILD_PIC ON CACHE BOOL
-    "Build cpu_features with Position Independent Code (PIC)."
-    FORCE)
-  set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}")
-  set(BUILD_SHARED_LIBS OFF)
-  add_subdirectory(cpu_features)
-  set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}")
+  find_package(CpuFeatures)
 else()
   message(STATUS "Building Volk without cpu_features")
 endif()
index fb9a8f9214df0c375e69d5218379fc318a07e8f0..5764cac512a7ca4aa423343b664b2b01386249bd 100644 (file)
@@ -517,7 +517,7 @@ target_include_directories(volk_obj
 if(VOLK_CPU_FEATURES)
   set_source_files_properties(volk_cpu.c PROPERTIES COMPILE_DEFINITIONS "VOLK_CPU_FEATURES=1")
   target_include_directories(volk_obj
-    PRIVATE $<TARGET_PROPERTY:cpu_features,INTERFACE_INCLUDE_DIRECTORIES>
+    PRIVATE $<TARGET_PROPERTY:CpuFeatures::cpu_features,INTERFACE_INCLUDE_DIRECTORIES>
 )
 endif()