Skip to content

Commit

Permalink
msvc: copy openssl dlls (#6428)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitor-k authored Apr 21, 2023
1 parent 3dd6557 commit c9b2bd9
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .ci/windows-msvc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ cmake .. \
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
-DUSE_DISCORD_PRESENCE=ON \
-DENABLE_MF=ON \
-DENABLE_FFMPEG_VIDEO_DUMPER=ON
-DENABLE_FFMPEG_VIDEO_DUMPER=ON \
-DOPENSSL_DLL_DIR="C:\Program Files\OpenSSL\bin"

ninja
# show the caching efficiency
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
CMAKE_DEPENDENT_OPTION(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" ON "ENABLE_QT;MSVC" OFF)

option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
if (MSVC)
set(OPENSSL_DLL_DIR "" CACHE PATH "Location of the Openssl dlls")
endif()

option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)

Expand Down
6 changes: 6 additions & 0 deletions CMakeModules/CopyCitraOpensslDeps.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function(copy_citra_openssl_deps target_dir)
include(WindowsCopyFiles)
set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
windows_copy_files(${target_dir} ${OPENSSL_DLL_DIR} ${DLL_DEST} libcrypto-1_1-x64.dll)
windows_copy_files(${target_dir} ${OPENSSL_DLL_DIR} ${DLL_DEST} libssl-1_1-x64.dll)
endfunction(copy_citra_openssl_deps)
4 changes: 4 additions & 0 deletions src/citra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ endif()
if (MSVC)
include(CopyCitraSDLDeps)
copy_citra_SDL_deps(citra)
if (ENABLE_WEB_SERVICE AND OPENSSL_DLL_DIR)
include(CopyCitraOpensslDeps)
copy_citra_openssl_deps(citra)
endif()
endif()

if (CITRA_USE_PRECOMPILED_HEADERS)
Expand Down
4 changes: 4 additions & 0 deletions src/citra_qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ if (MSVC)
include(CopyCitraSDLDeps)
copy_citra_Qt5_deps(citra-qt)
copy_citra_SDL_deps(citra-qt)
if (ENABLE_WEB_SERVICE AND OPENSSL_DLL_DIR)
include(CopyCitraOpensslDeps)
copy_citra_openssl_deps(citra-qt)
endif()

if (ENABLE_FFMPEG)
include(CopyCitraFFmpegDeps)
Expand Down
4 changes: 4 additions & 0 deletions src/dedicated_room/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ target_link_libraries(citra-room PRIVATE common network)
if (ENABLE_WEB_SERVICE)
target_compile_definitions(citra-room PRIVATE -DENABLE_WEB_SERVICE)
target_link_libraries(citra-room PRIVATE web_service)
if (MSVC AND OPENSSL_DLL_DIR)
include(CopyCitraOpensslDeps)
copy_citra_openssl_deps(citra-room)
endif()
endif()

target_link_libraries(citra-room PRIVATE cryptopp)
Expand Down

0 comments on commit c9b2bd9

Please sign in to comment.