Skip to content

Commit 966a183

Browse files
committed
Fix Argon2 build for ARM64
1 parent a37f7f4 commit 966a183

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/Argon2.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ if(NOT TARGET Argon2)
44
find_package(Threads REQUIRED)
55

66
# Module library
7-
file(GLOB SOURCE_FILES "Argon2/src/argon2.c" "Argon2/src/core.c" "Argon2/src/encoding.c" "Argon2/src/opt.c" "Argon2/src/thread.c" "Argon2/src/blake2/blake2b.c")
8-
add_library(Argon2 ${SOURCE_FILES})
7+
file(GLOB SOURCE_FILES "Argon2/src/argon2.c" "Argon2/src/core.c" "Argon2/src/encoding.c" "Argon2/src/thread.c" "Argon2/src/blake2/blake2b.c")
8+
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
9+
file(GLOB SOURCE_PALTFORM_FILES "Argon2/src/ref.c")
10+
else()
11+
file(GLOB SOURCE_PALTFORM_FILES "Argon2/src/opt.c")
12+
endif()
13+
add_library(Argon2 ${SOURCE_FILES} ${SOURCE_PALTFORM_FILES})
914
if(MSVC)
1015
# C4100: 'identifier' : unreferenced formal parameter
1116
# C4204: nonstandard extension used : non-constant aggregate initializer

0 commit comments

Comments
 (0)