Skip to content

Commit

Permalink
externals: Switch to newer cryptopp-cmake. (#6242)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveice10 authored Jan 15, 2023
1 parent bd1cabc commit a298e49
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 457 deletions.
3 changes: 1 addition & 2 deletions .ci/macos/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export ASM="clang"
ccache -s

mkdir build && cd build
# TODO: CryptoPP and LibreSSL ASM disabled due to platform detection issues in build.
# TODO: LibreSSL ASM disabled due to platform detection issues in build.
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
-DENABLE_QT_TRANSLATION=ON \
Expand All @@ -24,7 +24,6 @@ cmake .. -DCMAKE_BUILD_TYPE=Release \
-DUSE_DISCORD_PRESENCE=ON \
-DENABLE_FFMPEG_AUDIO_DECODER=ON \
-DENABLE_FFMPEG_VIDEO_DUMPER=ON \
-DCRYPTOPP_OPT_DISABLE_ASM=ON \
-DENABLE_ASM=OFF \
-GNinja
ninja
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
[submodule "xbyak"]
path = externals/xbyak
url = https://github.com/herumi/xbyak.git
[submodule "cryptopp"]
path = externals/cryptopp/cryptopp
url = https://github.com/weidai11/cryptopp.git
[submodule "fmt"]
path = externals/fmt
url = https://github.com/fmtlib/fmt.git
Expand Down Expand Up @@ -58,3 +55,6 @@
[submodule "sdl2"]
path = externals/sdl2/SDL
url = https://github.com/libsdl-org/SDL
[submodule "cryptopp-cmake"]
path = externals/cryptopp-cmake
url = https://github.com/abdes/cryptopp-cmake.git
19 changes: 18 additions & 1 deletion externals/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions externals/cryptopp-cmake
Submodule cryptopp-cmake added at 15798a
Loading

0 comments on commit a298e49

Please sign in to comment.