Skip to content

Commit

Permalink
Separate Hwacps to freebsd and linux implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mykola Hohsdze authored and toor1245 committed Sep 8, 2023
1 parent 2b7c47a commit 848d074
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_OBJECTS:utils>)
if(NOT PROCESSOR_IS_X86 AND UNIX)
Expand Down
2 changes: 2 additions & 0 deletions src/hwcaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "internal/hwcaps.h"

#include <stdbool.h>

static bool IsSet(const uint32_t mask, const uint32_t value) {
if (mask == 0) return false;
return (value & mask) == mask;
Expand Down
6 changes: 5 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

#
Expand Down

0 comments on commit 848d074

Please sign in to comment.