Skip to content

Commit

Permalink
Changes to support Apple M1
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmang9 committed Mar 4, 2021
1 parent a252a5b commit 6a8176d
Show file tree
Hide file tree
Showing 2 changed files with 6,099 additions and 2,565 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
ENDIF()

IF (APPLE)
# on macOS "uname -m" returns the architecture (x86_64 or arm64)
execute_process(
COMMAND uname -m
RESULT_VARIABLE result
OUTPUT_VARIABLE OSX_NATIVE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
ENDIF()

IF (WIN32)
set(BLAKE3_SRC
src/b3/blake3.c
Expand All @@ -88,6 +97,12 @@ set(BLAKE3_SRC
src/b3/blake3_avx512.c
src/b3/blake3_sse41.c
)
ELSEIF(OSX_NATIVE_ARCHITECTURE STREQUAL "arm64")
set(BLAKE3_SRC
src/b3/blake3.c
src/b3/blake3_portable.c
src/b3/blake3_dispatch.c
)
ELSE()
set(BLAKE3_SRC
src/b3/blake3.c
Expand Down
Loading

0 comments on commit 6a8176d

Please sign in to comment.