Skip to content

Commit

Permalink
build(CMake): Apply PP definitions to all sources
Browse files Browse the repository at this point in the history
  • Loading branch information
BurningEnlightenment authored and oconnor663 committed Oct 2, 2023
1 parent 3d921ae commit dd30dcb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ macro(BLAKE3_DISABLE_SIMD)
set(BLAKE3_SIMD_AMD64_ASM OFF)
set(BLAKE3_SIMD_X86_INTRINSICS OFF)
set(BLAKE3_SIMD_NEON_INTRINSICS OFF)
set_source_files_properties(blake3_dispatch.c PROPERTIES
COMPILE_DEFINITIONS BLAKE3_USE_NEON=0;BLAKE3_NO_SSE2;BLAKE3_NO_SSE41;BLAKE3_NO_AVX2;BLAKE3_NO_AVX512
target_compile_definitions(blake3 PRIVATE
BLAKE3_USE_NEON=0
BLAKE3_NO_SSE2
BLAKE3_NO_SSE41
BLAKE3_NO_AVX2
BLAKE3_NO_AVX512
)
endmacro()

Expand Down Expand Up @@ -131,7 +135,9 @@ elseif(CMAKE_SYSTEM_PROCESSOR IN_LIST BLAKE3_ARMv8_NAMES
target_sources(blake3 PRIVATE
blake3_neon.c
)
set_source_files_properties(blake3_dispatch.c PROPERTIES COMPILE_DEFINITIONS BLAKE3_USE_NEON=1)
target_compile_definitions(blake3 PRIVATE
BLAKE3_USE_NEON=1
)

if (DEFINED BLAKE3_CFLAGS_NEON)
set_source_files_properties(blake3_neon.c PROPERTIES COMPILE_FLAGS "${BLAKE3_CFLAGS_NEON}")
Expand Down

0 comments on commit dd30dcb

Please sign in to comment.