Do not include crypt when not available

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Thomas Arp
2026-04-22 22:45:41 +02:00
committed by GitHub
parent 6566ad5164
commit 83d109e7ae

View File

@@ -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