diff --git a/.gitmodules b/.gitmodules index f1a70f41..b1e05423 100644 --- a/.gitmodules +++ b/.gitmodules @@ -82,3 +82,6 @@ [submodule "third_party/fdk-aac"] path = third_party/fdk-aac url = https://github.com/Panda3DS-emu/fdk-aac/ +[submodule "third_party/cryptoppwin"] + path = third_party/cryptoppwin + url = https://github.com/shadps4-emu/ext-cryptoppwin diff --git a/CMakeLists.txt b/CMakeLists.txt index 051831e0..280abf0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,7 +127,6 @@ include_directories(third_party/elfio/) include_directories(third_party/hips/include/) include_directories(third_party/imgui/) include_directories(third_party/dynarmic/src) -include_directories(third_party/cryptopp/) include_directories(third_party/cityhash/include) include_directories(third_party/result/include) include_directories(third_party/xxhash/include) @@ -183,10 +182,21 @@ if(ANDROID) target_link_libraries(AlberCore PRIVATE EGL log) endif() -set(CRYPTOPP_BUILD_TESTING OFF) -add_subdirectory(third_party/cryptopp) add_subdirectory(third_party/glad) +# Cryptopp doesn't support compiling under clang-cl, so we have to include it as a prebuilt MSVC static library +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND MSVC) + add_subdirectory(third_party/cryptoppwin) + include_directories(third_party/cryptoppwin/include) + target_link_libraries(AlberCore PRIVATE cryptoppwin) +else() + set(CRYPTOPP_BUILD_TESTING OFF) + + add_subdirectory(third_party/cryptopp) + include_directories(third_party/cryptopp) + target_link_libraries(AlberCore PRIVATE cryptopp) +endif() + if(ENABLE_LUAJIT) add_subdirectory(third_party/LuaJIT luajit) include_directories(third_party/LuaJIT/src ${CMAKE_BINARY_DIR}/luajit) @@ -577,7 +587,7 @@ set(ALL_SOURCES ${SOURCE_FILES} ${FS_SOURCE_FILES} ${CRYPTO_SOURCE_FILES} ${KERN ${AUDIO_SOURCE_FILES} ${HEADER_FILES} ${FRONTEND_HEADER_FILES}) target_sources(AlberCore PRIVATE ${ALL_SOURCES}) -target_link_libraries(AlberCore PRIVATE dynarmic cryptopp glad resources_console_fonts teakra fdk-aac) +target_link_libraries(AlberCore PRIVATE dynarmic glad resources_console_fonts teakra fdk-aac) target_link_libraries(AlberCore PUBLIC glad capstone fmt::fmt) if(ENABLE_DISCORD_RPC AND NOT ANDROID) diff --git a/third_party/cryptoppwin b/third_party/cryptoppwin new file mode 160000 index 00000000..bc3441dd --- /dev/null +++ b/third_party/cryptoppwin @@ -0,0 +1 @@ +Subproject commit bc3441dd2d6a9728e747dc0180bc8b9065a2923c