mirror of
https://github.com/GerbilSoft/rvthtool.git
synced 2025-06-18 11:35:33 -04:00

Otherwise, encryption will be disabled, even if Nettle is available.
This fixes a regression from commit 03ce73c612
.
([cmake] CheckNettle2or3.cmake: Convert the macro to a function.)
Also, remove the ENABLE_DECRYPTION section. That's a leftover from
rom-properties, and rvthtool *requires* support for decryption.
25 lines
987 B
CMake
25 lines
987 B
CMake
# Check for Nettle v2 or v3.
|
|
# If either version is found, HAVE_NETTLE will be set.
|
|
# If Nettle v3 is found, HAVE_NETTLE_3 will be set.
|
|
|
|
FUNCTION(CHECK_NETTLE_2_OR_3)
|
|
FIND_PACKAGE(NETTLE)
|
|
SET(HAVE_NETTLE ${NETTLE_FOUND})
|
|
SET(HAVE_NETTLE ${NETTLE_FOUND} PARENT_SCOPE)
|
|
IF(HAVE_NETTLE)
|
|
# Check if this is Nettle 3.x.
|
|
# Nettle 3.1 added version.h, which isn't available
|
|
# in older verisons, so we can't simply check that.
|
|
INCLUDE(CheckSymbolExists)
|
|
SET(CMAKE_REQUIRED_INCLUDES ${NETTLE_INCLUDE_DIRS})
|
|
SET(CMAKE_REQUIRED_LIBRARIES ${NETTLE_LIBRARY})
|
|
CHECK_SYMBOL_EXISTS(aes128_set_decrypt_key "nettle/aes.h" HAVE_NETTLE_3)
|
|
IF(HAVE_NETTLE_3)
|
|
# Check for Nettle versioning symbols.
|
|
# Nettle 3.1 added version.h.
|
|
CHECK_SYMBOL_EXISTS(NETTLE_VERSION_MAJOR "nettle/version.h" HAVE_NETTLE_VERSION_H)
|
|
CHECK_SYMBOL_EXISTS(nettle_version_major "nettle/version.h" HAVE_NETTLE_VERSION_FUNCTIONS)
|
|
ENDIF(HAVE_NETTLE_3)
|
|
ENDIF(HAVE_NETTLE)
|
|
ENDFUNCTION(CHECK_NETTLE_2_OR_3)
|