Apply suggestions from code review

Co-authored-by: Adriaan de Groot <groot@kde.org>
This commit is contained in:
Evan Maddock 2023-11-27 19:02:50 -05:00 committed by GitHub
parent 559d19018c
commit 1b07de6fa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,9 +8,11 @@ find_package(Crypt REQUIRED)
# Check for crypt_gensalt
if(Crypt_FOUND)
set(_old_CRL "${CMAKE_REQUIRED_LIBRARIES}")
list(APPEND CMAKE_REQUIRED_LIBRARIES crypt)
include(CheckSymbolExists)
check_symbol_exists(crypt_gensalt crypt.h HAS_CRYPT_GENSALT)
set(CMAKE_REQUIRED_LIBRARIES "${_old_CRL}")
if(HAS_CRYPT_GENSALT)
add_definitions(-DHAVE_CRYPT_GENSALT)
endif()