diff --git a/.ci/windows/build.sh b/.ci/windows/build.sh index d0c697655a..7504630a57 100644 --- a/.ci/windows/build.sh +++ b/.ci/windows/build.sh @@ -43,17 +43,16 @@ export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" $@) mkdir -p build && cd build cmake .. -G Ninja \ -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ - -DENABLE_QT_TRANSLATION=ON \ + -DENABLE_QT_TRANSLATION=ON \ -DUSE_DISCORD_PRESENCE=ON \ - -DYUZU_USE_BUNDLED_SDL2=OFF \ - -DYUZU_USE_EXTERNAL_SDL2=ON \ + -DYUZU_USE_BUNDLED_SDL2=ON \ -DYUZU_TESTS=OFF \ -DYUZU_CMD=OFF \ -DYUZU_ROOM_STANDALONE=OFF \ -DYUZU_USE_QT_MULTIMEDIA=$MULTIMEDIA \ -DYUZU_USE_QT_WEB_ENGINE=$WEBENGINE \ -DYUZU_ENABLE_LTO=ON \ - "${EXTRA_CMAKE_FLAGS[@]}" + "${EXTRA_CMAKE_FLAGS[@]}" ninja diff --git a/.patch/httplib/0001-ssl-libs.patch b/.patch/httplib/0001-ssl-libs.patch deleted file mode 100644 index ba39a31a65..0000000000 --- a/.patch/httplib/0001-ssl-libs.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5638fb9..6e24c74 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -113,16 +113,8 @@ endif() - # Threads needed for on some systems, and for on Linux - set(THREADS_PREFER_PTHREAD_FLAG true) - find_package(Threads REQUIRED) --# Since Cmake v3.11, Crypto & SSL became optional when not specified as COMPONENTS. --if(HTTPLIB_REQUIRE_OPENSSL) -- find_package(OpenSSL ${_HTTPLIB_OPENSSL_MIN_VER} COMPONENTS Crypto SSL REQUIRED) --elseif(HTTPLIB_USE_OPENSSL_IF_AVAILABLE) -- find_package(OpenSSL ${_HTTPLIB_OPENSSL_MIN_VER} COMPONENTS Crypto SSL QUIET) --endif() --# Just setting this variable here for people building in-tree --if(OPENSSL_FOUND AND NOT DEFINED HTTPLIB_IS_USING_OPENSSL) -- set(HTTPLIB_IS_USING_OPENSSL TRUE) --endif() -+ -+set(HTTPLIB_IS_USING_OPENSSL TRUE) - - if(HTTPLIB_REQUIRE_ZLIB) - find_package(ZLIB REQUIRED) -@@ -227,8 +219,8 @@ target_link_libraries(${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC} - $<$:Brotli::encoder> - $<$:Brotli::decoder> - $<$:ZLIB::ZLIB> -- $<$:OpenSSL::SSL> -- $<$:OpenSSL::Crypto> -+ $<$:ssl> -+ $<$:crypto> - ) - - # Set the definitions to enable optional features diff --git a/.patch/quazip/0001-libz.patch b/.patch/quazip/0001-libz.patch deleted file mode 100644 index 1fe09edf64..0000000000 --- a/.patch/quazip/0001-libz.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fcb5417..f8f71e3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -109,8 +109,7 @@ if(NOT QUAZIP_QT_ZLIB_USED) - - set(QUAZIP_LIB_LIBRARIES ${QUAZIP_LIB_LIBRARIES} ${ZLIB_LIBRARY}) - else() -- find_package(ZLIB REQUIRED) -- set(QUAZIP_LIB_LIBRARIES ${QUAZIP_LIB_LIBRARIES} ZLIB::ZLIB) -+ set(QUAZIP_LIB_LIBRARIES ${QUAZIP_LIB_LIBRARIES} z) - endif() - endif() - diff --git a/vcpkg.json b/.vcpkg.json similarity index 100% rename from vcpkg.json rename to .vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 4769d4a4a0..1822ae8f40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,11 +135,6 @@ CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead set(DEFAULT_ENABLE_OPENSSL ON) if (ANDROID OR WIN32 OR APPLE OR ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") - set(DEFAULT_ENABLE_OPENSSL OFF) -endif() -option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL}) - -if (ANDROID OR WIN32 OR APPLE) # - Windows defaults to the Schannel backend. # - macOS defaults to the SecureTransport backend. # - Android currently has no SSL backend as the NDK doesn't include any SSL @@ -148,6 +143,11 @@ if (ANDROID OR WIN32 OR APPLE) # your own copy of it. set(DEFAULT_ENABLE_OPENSSL OFF) endif() + +if (ENABLE_WEB_SERVICE) + set(DEFAULT_ENABLE_OPENSSL ON) +endif() + option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL}) if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL) @@ -421,6 +421,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) # System imported libraries # ======================================================================= +if(ENABLE_OPENSSL) + if (MSVC) + # default for slproweb + set(OPENSSL_ROOT_DIR "C:/Program Files/OpenSSL-Win64" CACHE STRING "OpenSSL install path") + endif() + + find_package(OpenSSL 1.1.1 REQUIRED) +endif() + # TODO(crueter): Nuke vcpkg entirely and move this to externals if (YUZU_USE_CPM) include(CPMUtil) @@ -431,6 +440,7 @@ if (YUZU_USE_CPM) set(BUILD_TESTING OFF) # TODO(crueter): renderdoc? + AddPackage( NAME boost URL "https://github.com/boostorg/boost/releases/download/boost-1.88.0/boost-1.88.0-cmake.7z" @@ -438,6 +448,10 @@ if (YUZU_USE_CPM) VERSION 1.57 ) + if (boost_ADDED AND WIN32) + add_compile_definitions(YUZU_BOOST_v1) + endif() + AddPackage( NAME fmt REPO fmtlib/fmt @@ -479,8 +493,15 @@ if (YUZU_USE_CPM) SHA 51b7f2abda HASH 16eaf1f3752489d12fd9ce30f7b5f7cbd5cb8ff53d617005a9847ae72d937f65e01e68be747f62d7ac19fd0c9aeba9956e60f16d6b465c5fdc2f3d08b4db2e6c VERSION 1.2 + OPTIONS + "ZLIB_BUILD_SHARED OFF" + "ZLIB_INSTALL OFF" ) + if (ZLIB_ADDED) + add_library(ZLIB::ZLIB ALIAS zlibstatic) + endif() + set(ZSTD_BUILD_SHARED OFF) AddPackage( NAME zstd @@ -495,16 +516,6 @@ if (YUZU_USE_CPM) add_subdirectory(${zstd_SOURCE_DIR}/build/cmake ${zstd_BINARY_DIR}) endif() - if (ENABLE_OPENSSL) - AddPackage( - NAME OpenSSL - REPO openssl/openssl - SHA 0893a62353 - HASH a16d7d18b756e3b96a365927f5ea595f0b4bd9a9442cf4e0a8a680a4e2169e70e84028aa0d5fc1f965fcabab90daa177968553f675a7097ea9b02b8d8eaf32a7 - VERSION 1.1.1 - ) - endif() - if (YUZU_TESTS OR DYNARMIC_TESTS) AddPackage( NAME Catch2 @@ -532,10 +543,6 @@ else() find_package(Catch2 3.0.1 REQUIRED) endif() - if(ENABLE_OPENSSL) - find_package(OpenSSL 1.1.1 REQUIRED) - endif() - if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID) find_package(gamemode 1.7 MODULE) endif() diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 3219268373..bce1257edd 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -238,10 +238,8 @@ if ((ENABLE_WEB_SERVICE OR ENABLE_QT_UPDATE_CHECKER)) HASH dd3fd0572f8367d8549e1319fd98368b3e75801a293b0c3ac9b4adb806473a4506a484b3d389dc5bee5acc460cb90af7a20e5df705a1696b56496b30b9ce7ed2 FIND_PACKAGE_ARGUMENTS "MODULE" OPTIONS - "HTTPLIB_REQUIRE_OPENSSL ON" + "HTTPLIB_REQUIRE_OPENSSL ${ENABLE_OPENSSL}" SYSTEM_PACKAGE ${YUZU_USE_SYSTEM_HTTPLIB} - PATCHES - ${CMAKE_SOURCE_DIR}/.patch/httplib/0001-ssl-libs.patch ) endif() diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index d706a074ea..7894f0a5f5 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -261,9 +261,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ) endif() -target_link_libraries(common PUBLIC Boost::headers fmt::fmt - stb::headers Threads::Threads) -target_link_libraries(common PRIVATE lz4::lz4 LLVM::Demangle) +target_link_libraries(common PUBLIC Boost::algorithm Boost::icl Boost::pool + fmt::fmt stb::headers Threads::Threads) +target_link_libraries(common PRIVATE lz4 LLVM::Demangle) if (TARGET libzstd_static) target_link_libraries(common PRIVATE libzstd_static) diff --git a/src/common/fs/file.h b/src/common/fs/file.h index 2e2396075d..246c3db5d6 100644 --- a/src/common/fs/file.h +++ b/src/common/fs/file.h @@ -183,18 +183,18 @@ public: FileType type = FileType::BinaryFile, FileShareFlag flag = FileShareFlag::ShareReadOnly); -#ifdef _WIN32 - template - void Open(const Path& path, FileAccessMode mode, FileType type = FileType::BinaryFile, - FileShareFlag flag = FileShareFlag::ShareReadOnly) { - using ValueType = typename Path::value_type; - if constexpr (IsChar) { - Open(ToU8String(path), mode, type, flag); - } else { - Open(std::filesystem::path{path}, mode, type, flag); - } - } -#endif +// #ifdef _WIN32 +// template +// void Open(const Path& path, FileAccessMode mode, FileType type = FileType::BinaryFile, +// FileShareFlag flag = FileShareFlag::ShareReadOnly) { +// using ValueType = typename Path::value_type; +// if constexpr (IsChar) { +// Open(ToU8String(path), mode, type, flag); +// } else { +// Open(std::filesystem::path{path}, mode, type, flag); +// } +// } +// #endif /// Closes the file if it is opened. void Close(); diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 1337e0d23d..26f2282f42 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1186,7 +1186,7 @@ endif() target_include_directories(core PRIVATE ${OPUS_INCLUDE_DIRS}) target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network video_core nx_tzdb tz) -target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API) +target_link_libraries(core PUBLIC Boost::container Boost::heap Boost::asio Boost::process Boost::crc PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API) if (MINGW) target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY}) endif() @@ -1241,7 +1241,7 @@ endif() if(ENABLE_OPENSSL) target_sources(core PRIVATE hle/service/ssl/ssl_backend_openssl.cpp) - target_link_libraries(core PRIVATE ssl) + target_link_libraries(core PRIVATE OpenSSL::SSL) elseif (APPLE) target_sources(core PRIVATE hle/service/ssl/ssl_backend_securetransport.cpp) diff --git a/src/core/debugger/debugger.cpp b/src/core/debugger/debugger.cpp index 84c846bab2..ff9bcf2253 100644 --- a/src/core/debugger/debugger.cpp +++ b/src/core/debugger/debugger.cpp @@ -5,7 +5,7 @@ #include #include -#if BOOST_VERSION > 108300 && !defined(_WINDOWS) && !defined(ANDROID) +#if BOOST_VERSION > 108300 && (!defined(_WINDOWS) || defined(YUZU_BOOST_v1)) && !defined(ANDROID) #include #else #include @@ -329,7 +329,7 @@ private: struct ConnectionState { boost::asio::ip::tcp::socket client_socket; -#if BOOST_VERSION > 108300 && !defined(_WINDOWS) && !defined(ANDROID) +#if BOOST_VERSION > 108300 && (!defined(_WINDOWS) || defined(YUZU_BOOST_v1)) && !defined(ANDROID) boost::process::v1::async_pipe signal_pipe; #else boost::process::async_pipe signal_pipe; diff --git a/src/dynarmic/src/dynarmic/CMakeLists.txt b/src/dynarmic/src/dynarmic/CMakeLists.txt index b1b24f207b..96c193c4b2 100644 --- a/src/dynarmic/src/dynarmic/CMakeLists.txt +++ b/src/dynarmic/src/dynarmic/CMakeLists.txt @@ -415,17 +415,12 @@ target_link_libraries(dynarmic merry::mcl ) -if (TARGET boost_headers) - target_link_libraries(dynarmic - PRIVATE - boost_headers - ) -else() - target_link_libraries(dynarmic - PRIVATE - Boost::headers - ) -endif() +target_link_libraries(dynarmic + PRIVATE + Boost::variant + Boost::icl + Boost::pool +) if (DYNARMIC_USE_LLVM) target_include_directories(dynarmic PRIVATE ${LLVM_INCLUDE_DIRS}) diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index fb42962840..473355e805 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -397,6 +397,7 @@ elseif(WIN32) endif() target_link_libraries(yuzu PRIVATE common core input_common frontend_common network video_core) +target_link_libraries(yuzu PRIVATE nlohmann_json::nlohmann_json) target_link_libraries(yuzu PRIVATE Boost::headers glad Qt6::Widgets) target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) diff --git a/src/yuzu/externals/CMakeLists.txt b/src/yuzu/externals/CMakeLists.txt index ddc1ad0e0a..183d613f04 100644 --- a/src/yuzu/externals/CMakeLists.txt +++ b/src/yuzu/externals/CMakeLists.txt @@ -21,6 +21,6 @@ AddPackage( SHA f838774d63 HASH 9f629a438699801244a106c8df6d5f8f8d19e80df54f530a89403a10c8c4e37a6e95606bbdd307f23636961e8ce34eb37a2186d589a1f227ac9c8e2c678e326e BUNDLED_PACKAGE ${YUZU_USE_CPM} - PATCHES - ${CMAKE_SOURCE_DIR}/.patch/quazip/0001-libz.patch + OPTIONS + "QUAZIP_INSTALL OFF" )