From 83d109e7aea1fa15f00cc30d0ea149fac0837529 Mon Sep 17 00:00:00 2001 From: Thomas Arp <357770+welcor@users.noreply.github.com> Date: Wed, 22 Apr 2026 22:45:41 +0200 Subject: [PATCH] Do not include crypt when not available Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- tests/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a88d4c9..1027283 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -81,8 +81,13 @@ add_mud_test(test_interpreter ${CMAKE_CURRENT_SOURCE_DIR}/test_interpreter.c ) -# crypt() is referenced from interpreter.c (nanny password hashing) -target_link_libraries(test_interpreter PRIVATE crypt) +# crypt() is referenced from interpreter.c (nanny password hashing). +# Reuse the crypt library detected by the top-level build when one is needed; +# on platforms where crypt() is provided by libc, no extra link library is +# required. +if(CRYPT_LIBRARY) + target_link_libraries(test_interpreter PRIVATE ${CRYPT_LIBRARY}) +endif() # --------------------------------------------------------------------------- # test_class — covers src/class.c