Skip to content
This repository was archived by the owner on Sep 8, 2026. It is now read-only.

Commit d8573d9

Browse files
committed
Fix clang static link failure by running ranlib on argon2 archive after build
1 parent de73ea0 commit d8573d9

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎external/argon2/CMakeLists.txt‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ endif()
7373

7474
add_library(argon2 STATIC ${ARGON2_SRC})
7575

76+
# Some toolchain combinations (notably clang/llvm on Linux) may emit a static
77+
# archive without a usable index, which fails at final link step.
78+
if(CMAKE_RANLIB)
79+
add_custom_command(
80+
TARGET argon2
81+
POST_BUILD
82+
COMMAND ${CMAKE_RANLIB} $<TARGET_FILE:argon2>
83+
COMMENT "-- Argon2: Indexing static archive with ranlib"
84+
)
85+
endif()
86+
7687
target_compile_definitions(argon2
7788
PUBLIC "A2_VISCTL"
7889
)

0 commit comments

Comments
 (0)