From 848d074798f3de156d6ad05fe767d0c9f847473f Mon Sep 17 00:00:00 2001 From: Mykola Hohsdze Date: Mon, 10 Apr 2023 23:49:52 +0300 Subject: [PATCH] Separate Hwacps to freebsd and linux implementation --- CMakeLists.txt | 3 +-- src/hwcaps.c | 2 ++ test/CMakeLists.txt | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76a02e7..c015f1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,8 +170,7 @@ endif() # library : cpu_features # set (CPU_FEATURES_HDRS) -set (CPU_FEATURES_SRCS - include/internal/hwcaps_linux_or_android.h) +set (CPU_FEATURES_SRCS) add_cpu_features_headers_and_sources(CPU_FEATURES_HDRS CPU_FEATURES_SRCS) list(APPEND CPU_FEATURES_SRCS $) if(NOT PROCESSOR_IS_X86 AND UNIX) diff --git a/src/hwcaps.c b/src/hwcaps.c index 18dd35b..6e2e9a8 100644 --- a/src/hwcaps.c +++ b/src/hwcaps.c @@ -14,6 +14,8 @@ #include "internal/hwcaps.h" +#include + static bool IsSet(const uint32_t mask, const uint32_t value) { if (mask == 0) return false; return (value & mask) == mask; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 122414f..12f3a21 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -22,7 +22,11 @@ add_library(stack_line_reader_for_test ../src/stack_line_reader.c) target_compile_definitions(stack_line_reader_for_test PUBLIC STACK_LINE_READER_BUFFER_SIZE=16) target_link_libraries(stack_line_reader_for_test string_view filesystem_for_testing) ##------------------------------------------------------------------------------ -add_library(all_libraries ../src/hwcaps.c ../src/stack_line_reader.c) +add_library(all_libraries + ../src/hwcaps.c + ../src/hwcaps_linux_or_android.c + ../src/hwcaps_freebsd.c + ../src/stack_line_reader.c) target_link_libraries(all_libraries hwcaps_for_testing stack_line_reader string_view) #