From 5cc37457151f686efd634ab66c46e05683a31c0d Mon Sep 17 00:00:00 2001 From: "A. Maitland Bottoms" Date: Sun, 27 Dec 2020 20:16:07 +0000 Subject: [PATCH] use system cpu_features package Author: Shengjing Zhu Last-Update: 2020-12-26 Gbp-Pq: Name use-system-cpu-features-package.patch --- CMakeLists.txt | 12 +----------- lib/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a22e033..1e12d54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,17 +124,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() diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index d91f8d5..4a4929e 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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 $ + PRIVATE $ ) endif() -- 2.30.2