[cmake] fix windows cpm and boost link
Signed-off-by: crueter <crueter@crueter.xyz>
This commit is contained in:
parent
25d641c28c
commit
f3d25cf8a5
13 changed files with 58 additions and 106 deletions
|
@ -45,8 +45,7 @@ cmake .. -G Ninja \
|
||||||
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
||||||
-DENABLE_QT_TRANSLATION=ON \
|
-DENABLE_QT_TRANSLATION=ON \
|
||||||
-DUSE_DISCORD_PRESENCE=ON \
|
-DUSE_DISCORD_PRESENCE=ON \
|
||||||
-DYUZU_USE_BUNDLED_SDL2=OFF \
|
-DYUZU_USE_BUNDLED_SDL2=ON \
|
||||||
-DYUZU_USE_EXTERNAL_SDL2=ON \
|
|
||||||
-DYUZU_TESTS=OFF \
|
-DYUZU_TESTS=OFF \
|
||||||
-DYUZU_CMD=OFF \
|
-DYUZU_CMD=OFF \
|
||||||
-DYUZU_ROOM_STANDALONE=OFF \
|
-DYUZU_ROOM_STANDALONE=OFF \
|
||||||
|
|
|
@ -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 <thread> on some systems, and for <pthread.h> 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}
|
|
||||||
$<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:Brotli::encoder>
|
|
||||||
$<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:Brotli::decoder>
|
|
||||||
$<$<BOOL:${HTTPLIB_IS_USING_ZLIB}>:ZLIB::ZLIB>
|
|
||||||
- $<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:OpenSSL::SSL>
|
|
||||||
- $<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:OpenSSL::Crypto>
|
|
||||||
+ $<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:ssl>
|
|
||||||
+ $<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:crypto>
|
|
||||||
)
|
|
||||||
|
|
||||||
# Set the definitions to enable optional features
|
|
|
@ -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()
|
|
||||||
|
|
|
@ -135,11 +135,6 @@ CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead
|
||||||
|
|
||||||
set(DEFAULT_ENABLE_OPENSSL ON)
|
set(DEFAULT_ENABLE_OPENSSL ON)
|
||||||
if (ANDROID OR WIN32 OR APPLE OR ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
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.
|
# - Windows defaults to the Schannel backend.
|
||||||
# - macOS defaults to the SecureTransport backend.
|
# - macOS defaults to the SecureTransport backend.
|
||||||
# - Android currently has no SSL backend as the NDK doesn't include any SSL
|
# - 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.
|
# your own copy of it.
|
||||||
set(DEFAULT_ENABLE_OPENSSL OFF)
|
set(DEFAULT_ENABLE_OPENSSL OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (ENABLE_WEB_SERVICE)
|
||||||
|
set(DEFAULT_ENABLE_OPENSSL ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL})
|
option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL})
|
||||||
|
|
||||||
if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL)
|
if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL)
|
||||||
|
@ -421,6 +421,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
||||||
# System imported libraries
|
# 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
|
# TODO(crueter): Nuke vcpkg entirely and move this to externals
|
||||||
if (YUZU_USE_CPM)
|
if (YUZU_USE_CPM)
|
||||||
include(CPMUtil)
|
include(CPMUtil)
|
||||||
|
@ -431,6 +440,7 @@ if (YUZU_USE_CPM)
|
||||||
set(BUILD_TESTING OFF)
|
set(BUILD_TESTING OFF)
|
||||||
|
|
||||||
# TODO(crueter): renderdoc?
|
# TODO(crueter): renderdoc?
|
||||||
|
|
||||||
AddPackage(
|
AddPackage(
|
||||||
NAME boost
|
NAME boost
|
||||||
URL "https://github.com/boostorg/boost/releases/download/boost-1.88.0/boost-1.88.0-cmake.7z"
|
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
|
VERSION 1.57
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (boost_ADDED AND WIN32)
|
||||||
|
add_compile_definitions(YUZU_BOOST_v1)
|
||||||
|
endif()
|
||||||
|
|
||||||
AddPackage(
|
AddPackage(
|
||||||
NAME fmt
|
NAME fmt
|
||||||
REPO fmtlib/fmt
|
REPO fmtlib/fmt
|
||||||
|
@ -479,8 +493,15 @@ if (YUZU_USE_CPM)
|
||||||
SHA 51b7f2abda
|
SHA 51b7f2abda
|
||||||
HASH 16eaf1f3752489d12fd9ce30f7b5f7cbd5cb8ff53d617005a9847ae72d937f65e01e68be747f62d7ac19fd0c9aeba9956e60f16d6b465c5fdc2f3d08b4db2e6c
|
HASH 16eaf1f3752489d12fd9ce30f7b5f7cbd5cb8ff53d617005a9847ae72d937f65e01e68be747f62d7ac19fd0c9aeba9956e60f16d6b465c5fdc2f3d08b4db2e6c
|
||||||
VERSION 1.2
|
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)
|
set(ZSTD_BUILD_SHARED OFF)
|
||||||
AddPackage(
|
AddPackage(
|
||||||
NAME zstd
|
NAME zstd
|
||||||
|
@ -495,16 +516,6 @@ if (YUZU_USE_CPM)
|
||||||
add_subdirectory(${zstd_SOURCE_DIR}/build/cmake ${zstd_BINARY_DIR})
|
add_subdirectory(${zstd_SOURCE_DIR}/build/cmake ${zstd_BINARY_DIR})
|
||||||
endif()
|
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)
|
if (YUZU_TESTS OR DYNARMIC_TESTS)
|
||||||
AddPackage(
|
AddPackage(
|
||||||
NAME Catch2
|
NAME Catch2
|
||||||
|
@ -532,10 +543,6 @@ else()
|
||||||
find_package(Catch2 3.0.1 REQUIRED)
|
find_package(Catch2 3.0.1 REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_OPENSSL)
|
|
||||||
find_package(OpenSSL 1.1.1 REQUIRED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID)
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID)
|
||||||
find_package(gamemode 1.7 MODULE)
|
find_package(gamemode 1.7 MODULE)
|
||||||
endif()
|
endif()
|
||||||
|
|
4
externals/CMakeLists.txt
vendored
4
externals/CMakeLists.txt
vendored
|
@ -238,10 +238,8 @@ if ((ENABLE_WEB_SERVICE OR ENABLE_QT_UPDATE_CHECKER))
|
||||||
HASH dd3fd0572f8367d8549e1319fd98368b3e75801a293b0c3ac9b4adb806473a4506a484b3d389dc5bee5acc460cb90af7a20e5df705a1696b56496b30b9ce7ed2
|
HASH dd3fd0572f8367d8549e1319fd98368b3e75801a293b0c3ac9b4adb806473a4506a484b3d389dc5bee5acc460cb90af7a20e5df705a1696b56496b30b9ce7ed2
|
||||||
FIND_PACKAGE_ARGUMENTS "MODULE"
|
FIND_PACKAGE_ARGUMENTS "MODULE"
|
||||||
OPTIONS
|
OPTIONS
|
||||||
"HTTPLIB_REQUIRE_OPENSSL ON"
|
"HTTPLIB_REQUIRE_OPENSSL ${ENABLE_OPENSSL}"
|
||||||
SYSTEM_PACKAGE ${YUZU_USE_SYSTEM_HTTPLIB}
|
SYSTEM_PACKAGE ${YUZU_USE_SYSTEM_HTTPLIB}
|
||||||
PATCHES
|
|
||||||
${CMAKE_SOURCE_DIR}/.patch/httplib/0001-ssl-libs.patch
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -261,9 +261,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(common PUBLIC Boost::headers fmt::fmt
|
target_link_libraries(common PUBLIC Boost::algorithm Boost::icl Boost::pool
|
||||||
stb::headers Threads::Threads)
|
fmt::fmt stb::headers Threads::Threads)
|
||||||
target_link_libraries(common PRIVATE lz4::lz4 LLVM::Demangle)
|
target_link_libraries(common PRIVATE lz4 LLVM::Demangle)
|
||||||
|
|
||||||
if (TARGET libzstd_static)
|
if (TARGET libzstd_static)
|
||||||
target_link_libraries(common PRIVATE libzstd_static)
|
target_link_libraries(common PRIVATE libzstd_static)
|
||||||
|
|
|
@ -183,18 +183,18 @@ public:
|
||||||
FileType type = FileType::BinaryFile,
|
FileType type = FileType::BinaryFile,
|
||||||
FileShareFlag flag = FileShareFlag::ShareReadOnly);
|
FileShareFlag flag = FileShareFlag::ShareReadOnly);
|
||||||
|
|
||||||
#ifdef _WIN32
|
// #ifdef _WIN32
|
||||||
template <typename Path>
|
// template <typename Path>
|
||||||
void Open(const Path& path, FileAccessMode mode, FileType type = FileType::BinaryFile,
|
// void Open(const Path& path, FileAccessMode mode, FileType type = FileType::BinaryFile,
|
||||||
FileShareFlag flag = FileShareFlag::ShareReadOnly) {
|
// FileShareFlag flag = FileShareFlag::ShareReadOnly) {
|
||||||
using ValueType = typename Path::value_type;
|
// using ValueType = typename Path::value_type;
|
||||||
if constexpr (IsChar<ValueType>) {
|
// if constexpr (IsChar<ValueType>) {
|
||||||
Open(ToU8String(path), mode, type, flag);
|
// Open(ToU8String(path), mode, type, flag);
|
||||||
} else {
|
// } else {
|
||||||
Open(std::filesystem::path{path}, mode, type, flag);
|
// Open(std::filesystem::path{path}, mode, type, flag);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
/// Closes the file if it is opened.
|
/// Closes the file if it is opened.
|
||||||
void Close();
|
void Close();
|
||||||
|
|
|
@ -1186,7 +1186,7 @@ endif()
|
||||||
|
|
||||||
target_include_directories(core PRIVATE ${OPUS_INCLUDE_DIRS})
|
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 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)
|
if (MINGW)
|
||||||
target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
|
target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
@ -1241,7 +1241,7 @@ endif()
|
||||||
if(ENABLE_OPENSSL)
|
if(ENABLE_OPENSSL)
|
||||||
target_sources(core PRIVATE
|
target_sources(core PRIVATE
|
||||||
hle/service/ssl/ssl_backend_openssl.cpp)
|
hle/service/ssl/ssl_backend_openssl.cpp)
|
||||||
target_link_libraries(core PRIVATE ssl)
|
target_link_libraries(core PRIVATE OpenSSL::SSL)
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
target_sources(core PRIVATE
|
target_sources(core PRIVATE
|
||||||
hle/service/ssl/ssl_backend_securetransport.cpp)
|
hle/service/ssl/ssl_backend_securetransport.cpp)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/version.hpp>
|
#include <boost/version.hpp>
|
||||||
#if BOOST_VERSION > 108300 && !defined(_WINDOWS) && !defined(ANDROID)
|
#if BOOST_VERSION > 108300 && (!defined(_WINDOWS) || defined(YUZU_BOOST_v1)) && !defined(ANDROID)
|
||||||
#include <boost/process/v1/async_pipe.hpp>
|
#include <boost/process/v1/async_pipe.hpp>
|
||||||
#else
|
#else
|
||||||
#include <boost/process/async_pipe.hpp>
|
#include <boost/process/async_pipe.hpp>
|
||||||
|
@ -329,7 +329,7 @@ private:
|
||||||
|
|
||||||
struct ConnectionState {
|
struct ConnectionState {
|
||||||
boost::asio::ip::tcp::socket client_socket;
|
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;
|
boost::process::v1::async_pipe signal_pipe;
|
||||||
#else
|
#else
|
||||||
boost::process::async_pipe signal_pipe;
|
boost::process::async_pipe signal_pipe;
|
||||||
|
|
|
@ -415,17 +415,12 @@ target_link_libraries(dynarmic
|
||||||
merry::mcl
|
merry::mcl
|
||||||
)
|
)
|
||||||
|
|
||||||
if (TARGET boost_headers)
|
target_link_libraries(dynarmic
|
||||||
target_link_libraries(dynarmic
|
|
||||||
PRIVATE
|
PRIVATE
|
||||||
boost_headers
|
Boost::variant
|
||||||
)
|
Boost::icl
|
||||||
else()
|
Boost::pool
|
||||||
target_link_libraries(dynarmic
|
)
|
||||||
PRIVATE
|
|
||||||
Boost::headers
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (DYNARMIC_USE_LLVM)
|
if (DYNARMIC_USE_LLVM)
|
||||||
target_include_directories(dynarmic PRIVATE ${LLVM_INCLUDE_DIRS})
|
target_include_directories(dynarmic PRIVATE ${LLVM_INCLUDE_DIRS})
|
||||||
|
|
|
@ -397,6 +397,7 @@ elseif(WIN32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(yuzu PRIVATE common core input_common frontend_common network video_core)
|
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 Boost::headers glad Qt6::Widgets)
|
||||||
target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
|
target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
|
||||||
|
|
||||||
|
|
4
src/yuzu/externals/CMakeLists.txt
vendored
4
src/yuzu/externals/CMakeLists.txt
vendored
|
@ -21,6 +21,6 @@ AddPackage(
|
||||||
SHA f838774d63
|
SHA f838774d63
|
||||||
HASH 9f629a438699801244a106c8df6d5f8f8d19e80df54f530a89403a10c8c4e37a6e95606bbdd307f23636961e8ce34eb37a2186d589a1f227ac9c8e2c678e326e
|
HASH 9f629a438699801244a106c8df6d5f8f8d19e80df54f530a89403a10c8c4e37a6e95606bbdd307f23636961e8ce34eb37a2186d589a1f227ac9c8e2c678e326e
|
||||||
BUNDLED_PACKAGE ${YUZU_USE_CPM}
|
BUNDLED_PACKAGE ${YUZU_USE_CPM}
|
||||||
PATCHES
|
OPTIONS
|
||||||
${CMAKE_SOURCE_DIR}/.patch/quazip/0001-libz.patch
|
"QUAZIP_INSTALL OFF"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue