Skip to content

Commit

Permalink
Allow compilation with clang-cl (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat authored Nov 19, 2024
1 parent 889c245 commit 20a6e0b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions third_party/cryptoppwin
Submodule cryptoppwin added at bc3441

0 comments on commit 20a6e0b

Please sign in to comment.