[cmake] refactor: SDL2 CI and CPMUtil::AddCIPackage (#284)

Replaces bundled SDL2 with my SDL2 CI, and updates external SDL2

Additionally, reduces all that boilerplate with a common AddCIPackage in
CPMUtil.cmake, currently used by OpenSSL and SDL2. To be used with ffmpeg in the future

Signed-off-by: crueter <crueter@crueter.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/284
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev>
This commit is contained in:
crueter 2025-08-23 19:42:49 +02:00
parent 5b864d406d
commit 94bcd64153
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
10 changed files with 281 additions and 307 deletions

View file

@ -1251,11 +1251,7 @@ if(ENABLE_OPENSSL)
find_package(OpenSSL REQUIRED)
if (OpenSSL_ADDED)
link_openssl(core)
else()
target_link_libraries(core PRIVATE OpenSSL::SSL)
endif()
target_link_libraries(core PRIVATE OpenSSL::SSL OpenSSL::Crypto)
elseif (APPLE)
target_sources(core PRIVATE
hle/service/ssl/ssl_backend_securetransport.cpp)

View file

@ -12,7 +12,7 @@
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
@ -162,7 +162,7 @@ Errno TranslateNativeError(int e, CallType call_type = CallType::Other) {
}
}
#elif defined(__unix__) // ^ _WIN32 v __unix__
#elif defined(__unix__) || defined(__APPLE__) // ^ _WIN32 v __unix__
using SOCKET = int;
using WSAPOLLFD = pollfd;

View file

@ -104,7 +104,7 @@ constexpr IPv4Address TranslateIPv4(in_addr addr) {
auto& bytes = addr.S_un.S_un_b;
return IPv4Address{bytes.s_b1, bytes.s_b2, bytes.s_b3, bytes.s_b4};
}
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
constexpr IPv4Address TranslateIPv4(in_addr addr) {
const u32 bytes = addr.s_addr;
return IPv4Address{static_cast<u8>(bytes), static_cast<u8>(bytes >> 8),

View file

@ -10,7 +10,7 @@
#if defined(_WIN32)
// windows
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
// unix
#else
// haiku
@ -28,7 +28,7 @@ struct ProxyPacket;
class SocketBase {
public:
#ifdef __unix__
#if defined(__unix__) || defined(__APPLE__)
using SOCKET = int;
static constexpr SOCKET INVALID_SOCKET = -1;
static constexpr SOCKET SOCKET_ERROR = -1;

View file

@ -18,12 +18,8 @@ create_target_directory_groups(web_service)
target_include_directories(web_service PUBLIC ${cpp-jwt_SOURCE_DIR}/include)
target_link_libraries(web_service PRIVATE common network nlohmann_json::nlohmann_json httplib::httplib cpp-jwt::cpp-jwt)
if (OpenSSL_ADDED)
link_openssl(web_service)
else()
find_package(OpenSSL REQUIRED)
target_link_libraries(web_service PRIVATE OpenSSL::SSL)
endif()
find_package(OpenSSL REQUIRED)
target_link_libraries(web_service PRIVATE OpenSSL::SSL OpenSSL::Crypto)
if (YUZU_USE_PRECOMPILED_HEADERS)
target_precompile_headers(web_service PRIVATE precompiled_headers.h)

View file

@ -406,7 +406,11 @@ if (NOT WIN32)
target_include_directories(yuzu PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
endif()
if (UNIX AND NOT APPLE)
target_link_libraries(yuzu PRIVATE Qt6::DBus Qt6::GuiPrivate)
target_link_libraries(yuzu PRIVATE Qt6::DBus)
if (TARGET Qt6::GuiPrivate)
target_link_libraries(yuzu PRIVATE Qt6::GuiPrivate)
endif()
endif()
target_compile_definitions(yuzu PRIVATE