externals: Switch to newer cryptopp-cmake. (#6242)

This commit is contained in:
Steveice10 2023-01-15 08:15:42 -08:00 committed by GitHub
parent bd1cabce86
commit a298e4969b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 457 deletions

View file

@ -29,7 +29,24 @@ set(CATCH_INSTALL_EXTRAS OFF)
add_subdirectory(catch2)
# Crypto++
add_subdirectory(cryptopp)
set(CRYPTOPP_BUILD_DOCUMENTATION OFF)
set(CRYPTOPP_BUILD_TESTING OFF)
set(CRYPTOPP_INSTALL OFF)
add_subdirectory(cryptopp-cmake)
# HACK: The logic to set up the base include directory for CryptoPP does not work with Android SDK CMake 3.22.1.
# Until there is a fixed version available, this code will detect and add in the proper include if it does not exist.
if(ANDROID)
message(STATUS "Applying CryptoPP include fix.")
get_target_property(CRYPTOPP_INCLUDES cryptopp INTERFACE_INCLUDE_DIRECTORIES)
foreach(CRYPTOPP_INCLUDE ${CRYPTOPP_INCLUDES})
if("${CRYPTOPP_INCLUDE}" MATCHES "\\$<BUILD_INTERFACE:(.*)/cryptopp>")
message(STATUS "Fixed include path: ${CMAKE_MATCH_1}")
target_include_directories(cryptopp PUBLIC $<BUILD_INTERFACE:${CMAKE_MATCH_1}>)
break()
endif()
endforeach()
endif()
# fmt and Xbyak need to be added before dynarmic
# libfmt