[cmake] CheckNettle2or3.cmake: Set HAVE_NETTLE locally *and* in PARENT_SCOPE.

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.
This commit is contained in:
David Korth 2024-05-17 22:37:44 -04:00
parent 86d340d407
commit f86d5c4ad4

View File

@ -4,6 +4,7 @@
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.
@ -19,8 +20,5 @@ FUNCTION(CHECK_NETTLE_2_OR_3)
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)
ELSE(HAVE_NETTLE)
# Disable decryption.
SET(ENABLE_DECRYPTION OFF CACHE INTERNAL "Enable decryption for newer ROM and disc images." FORCE)
ENDIF(HAVE_NETTLE)
ENDFUNCTION(CHECK_NETTLE_2_OR_3)