mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
b986e54039
Use the OpenSSL implementation of SHA256 if it is supported, otherwise fall back to a public domain one.
20 lines
538 B
CMake
20 lines
538 B
CMake
if(NOT PREFER_BUNDLED_LIBS)
|
|
find_package(OpenSSL)
|
|
if(OPENSSL_FOUND)
|
|
set(CRYPTO_FOUND ON)
|
|
set(CRYPTO_BUNDLED OFF)
|
|
set(CRYPTO_LIBRARY ${OPENSSL_CRYPTO_LIBRARY})
|
|
set(CRYPTO_INCLUDEDIR ${OPENSSL_INCLUDE_DIR})
|
|
endif()
|
|
endif()
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(Crypto DEFAULT_MSG CRYPTO_LIBRARY CRYPTO_INCLUDEDIR)
|
|
|
|
mark_as_advanced(CRYPTO_LIBRARY CRYPTO_INCLUDEDIR)
|
|
|
|
if(CRYPTO_FOUND)
|
|
set(CRYPTO_LIBRARIES ${CRYPTO_LIBRARY})
|
|
set(CRYPTO_INCLUDE_DIRS ${CRYPTO_INCLUDEDIR})
|
|
endif()
|