mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-27 09:23:01 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 46710a37bb | |||
| 22e5c009c2 | |||
| 6dad5281d1 | |||
| e0d992cf1a |
@@ -0,0 +1,40 @@
|
|||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index a236839..8d98365 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -188,18 +188,23 @@ set(HTTPLIB_IS_USING_NON_BLOCKING_GETADDRINFO ${HTTPLIB_USE_NON_BLOCKING_GETADDR
|
||||||
|
# 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)
|
||||||
|
- set(HTTPLIB_IS_USING_OPENSSL TRUE)
|
||||||
|
-elseif(HTTPLIB_USE_OPENSSL_IF_AVAILABLE)
|
||||||
|
- find_package(OpenSSL ${_HTTPLIB_OPENSSL_MIN_VER} COMPONENTS Crypto SSL QUIET)
|
||||||
|
- # Avoid a rare circumstance of not finding all components but the end-user did their
|
||||||
|
- # own call for OpenSSL, which might trick us into thinking we'd otherwise have what we wanted
|
||||||
|
- if (TARGET OpenSSL::SSL AND TARGET OpenSSL::Crypto)
|
||||||
|
- set(HTTPLIB_IS_USING_OPENSSL ${OPENSSL_FOUND})
|
||||||
|
- else()
|
||||||
|
- set(HTTPLIB_IS_USING_OPENSSL FALSE)
|
||||||
|
+
|
||||||
|
+# Eden top level defines it's own custom target alias for OpenSSL...
|
||||||
|
+if (NOT TARGET OpenSSL::SSL OR NOT TARGET OpenSSL::Crypto)
|
||||||
|
+ add_subdirectory(${CMAKE_SOURCE_DIR}/externals/openssl)
|
||||||
|
+ # 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)
|
||||||
|
+ set(HTTPLIB_IS_USING_OPENSSL TRUE)
|
||||||
|
+ elseif(HTTPLIB_USE_OPENSSL_IF_AVAILABLE)
|
||||||
|
+ #find_package(OpenSSL ${_HTTPLIB_OPENSSL_MIN_VER} COMPONENTS Crypto SSL QUIET)
|
||||||
|
+ # Avoid a rare circumstance of not finding all components but the end-user did their
|
||||||
|
+ # own call for OpenSSL, which might trick us into thinking we'd otherwise have what we wanted
|
||||||
|
+ if (TARGET OpenSSL::SSL AND TARGET OpenSSL::Crypto)
|
||||||
|
+ set(HTTPLIB_IS_USING_OPENSSL ${OPENSSL_FOUND})
|
||||||
|
+ else()
|
||||||
|
+ set(HTTPLIB_IS_USING_OPENSSL FALSE)
|
||||||
|
+ endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
+11
-11
@@ -66,6 +66,10 @@ if (YUZU_STATIC_ROOM)
|
|||||||
set(fmt_FORCE_BUNDLED ON)
|
set(fmt_FORCE_BUNDLED ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (YUZU_USE_EXTERNAL_OPENSSL)
|
||||||
|
set(httplib_FORCE_BUNDLED ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
# qt stuff
|
# qt stuff
|
||||||
option(ENABLE_QT "Enable the Qt frontend" ON)
|
option(ENABLE_QT "Enable the Qt frontend" ON)
|
||||||
option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
|
option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
|
||||||
@@ -207,6 +211,10 @@ endif()
|
|||||||
option(YUZU_USE_BUNDLED_FFMPEG "Download bundled FFmpeg" ${EXT_DEFAULT})
|
option(YUZU_USE_BUNDLED_FFMPEG "Download bundled FFmpeg" ${EXT_DEFAULT})
|
||||||
cmake_dependent_option(YUZU_USE_EXTERNAL_FFMPEG "Build FFmpeg from external source" "${PLATFORM_SUN}" "NOT WIN32 AND NOT ANDROID" OFF)
|
cmake_dependent_option(YUZU_USE_EXTERNAL_FFMPEG "Build FFmpeg from external source" "${PLATFORM_SUN}" "NOT WIN32 AND NOT ANDROID" OFF)
|
||||||
|
|
||||||
|
# openssl
|
||||||
|
option(YUZU_USE_BUNDLED_OPENSSL "Download bundled OpenSSL" ON)
|
||||||
|
option(YUZU_USE_EXTERNAL_OPENSSL "Build OpenSSL from external source" OFF)
|
||||||
|
|
||||||
# sirit
|
# sirit
|
||||||
set(BUNDLED_SIRIT_DEFAULT OFF)
|
set(BUNDLED_SIRIT_DEFAULT OFF)
|
||||||
if (MSVC AND NOT (CMAKE_BUILD_TYPE MATCHES "Deb") OR ANDROID)
|
if (MSVC AND NOT (CMAKE_BUILD_TYPE MATCHES "Deb") OR ANDROID)
|
||||||
@@ -378,17 +386,6 @@ find_package(Threads REQUIRED)
|
|||||||
|
|
||||||
find_package(RenderDoc MODULE)
|
find_package(RenderDoc MODULE)
|
||||||
|
|
||||||
# openssl funniness
|
|
||||||
if (YUZU_USE_BUNDLED_OPENSSL)
|
|
||||||
set(BUILD_SHARED_LIBS OFF)
|
|
||||||
AddJsonPackage(openssl)
|
|
||||||
if (OpenSSL_ADDED)
|
|
||||||
add_compile_definitions(YUZU_BUNDLED_OPENSSL)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(OpenSSL 3 REQUIRED)
|
|
||||||
|
|
||||||
message(STATUS "Fetching needed dependencies with CPM")
|
message(STATUS "Fetching needed dependencies with CPM")
|
||||||
|
|
||||||
set(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
@@ -424,6 +421,9 @@ if (Boost_ADDED)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# OpenSSL
|
||||||
|
add_subdirectory(externals/openssl)
|
||||||
|
|
||||||
# fmt
|
# fmt
|
||||||
AddJsonPackage(fmt)
|
AddJsonPackage(fmt)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
{
|
{
|
||||||
"openssl": {
|
"openssl": {
|
||||||
|
"package": "OpenSSL",
|
||||||
|
"name": "openssl",
|
||||||
|
"repo": "openssl/openssl",
|
||||||
|
"tag": "openssl-%VERSION%",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"git_version": "4.0.0"
|
||||||
|
},
|
||||||
|
"openssl-ci": {
|
||||||
"ci": true,
|
"ci": true,
|
||||||
"package": "OpenSSL",
|
"package": "OpenSSL",
|
||||||
"name": "openssl",
|
"name": "openssl",
|
||||||
|
|||||||
Vendored
+2
-1
@@ -33,7 +33,8 @@
|
|||||||
"find_args": "MODULE GLOBAL",
|
"find_args": "MODULE GLOBAL",
|
||||||
"patches": [
|
"patches": [
|
||||||
"0001-mingw.patch",
|
"0001-mingw.patch",
|
||||||
"0002-fix-zstd.patch"
|
"0002-fix-zstd.patch",
|
||||||
|
"0003-openssl.patch"
|
||||||
],
|
],
|
||||||
"options": [
|
"options": [
|
||||||
"HTTPLIB_REQUIRE_OPENSSL ON",
|
"HTTPLIB_REQUIRE_OPENSSL ON",
|
||||||
|
|||||||
Vendored
+102
@@ -0,0 +1,102 @@
|
|||||||
|
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
if (YUZU_USE_BUNDLED_OPENSSL)
|
||||||
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
AddJsonPackage(openssl-ci)
|
||||||
|
if (OpenSSL_ADDED)
|
||||||
|
add_compile_definitions(YUZU_BUNDLED_OPENSSL)
|
||||||
|
endif()
|
||||||
|
# openssl funniness
|
||||||
|
find_package(OpenSSL 3 COMPONENTS SSL Crypto REQUIRED)
|
||||||
|
else()
|
||||||
|
message(STATUS "Using OpenSSL from externals")
|
||||||
|
AddJsonPackage(openssl)
|
||||||
|
set(OpenSSL_PREFIX ${OpenSSL_SOURCE_DIR})
|
||||||
|
set(OpenSSL_BUILD_DIR ${OpenSSL_BINARY_DIR})
|
||||||
|
set(OpenSSL_MAKEFILE ${OpenSSL_BUILD_DIR}/Makefile)
|
||||||
|
set(OpenSSL_BUILD_LIBRARIES "")
|
||||||
|
list(APPEND OpenSSL_BUILD_LIBRARIES
|
||||||
|
"${OpenSSL_BUILD_DIR}/libssl.a"
|
||||||
|
"${OpenSSL_BUILD_DIR}/libcrypto.a")
|
||||||
|
|
||||||
|
make_directory(${OpenSSL_BUILD_DIR})
|
||||||
|
|
||||||
|
# The ABSOLUTE best language, hands down, better than bash by a MILE
|
||||||
|
find_program(PERL_PROGRAM perl)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT
|
||||||
|
${OpenSSL_MAKEFILE}
|
||||||
|
COMMAND
|
||||||
|
${PERL_PROGRAM} ${OpenSSL_PREFIX}/Configure
|
||||||
|
shared
|
||||||
|
no-makedepend
|
||||||
|
--release
|
||||||
|
threads
|
||||||
|
no-tests
|
||||||
|
no-docs
|
||||||
|
enable-camellia
|
||||||
|
enable-ec
|
||||||
|
enable-ec2m
|
||||||
|
enable-sm2
|
||||||
|
enable-srp
|
||||||
|
enable-idea
|
||||||
|
enable-mdc2
|
||||||
|
enable-rc5
|
||||||
|
enable-rfc3779
|
||||||
|
enable-asm
|
||||||
|
enable-quic
|
||||||
|
enable-fips
|
||||||
|
WORKING_DIRECTORY
|
||||||
|
${OpenSSL_BUILD_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Workaround for Ubuntu 18.04's older version of make not being able to call make as a child
|
||||||
|
# with context of the jobserver. Also helps ninja users.
|
||||||
|
execute_process(COMMAND nproc OUTPUT_VARIABLE SYSTEM_THREADS)
|
||||||
|
# BSD make or Solaris make don't support ffmpeg make-j8
|
||||||
|
set(OpenSSL_MAKE_ARGS "")
|
||||||
|
if (PLATFORM_LINUX OR ANDROID OR APPLE OR WIN32 OR PLATFORM_FREEBSD)
|
||||||
|
set(OpenSSL_MAKE_ARGS -j${SYSTEM_THREADS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT
|
||||||
|
${OpenSSL_BUILD_LIBRARIES}
|
||||||
|
COMMAND
|
||||||
|
gmake ${OpenSSL_MAKE_ARGS}
|
||||||
|
WORKING_DIRECTORY
|
||||||
|
${OpenSSL_BUILD_DIR}
|
||||||
|
)
|
||||||
|
add_custom_target(openssl-configure ALL DEPENDS ${OpenSSL_MAKEFILE})
|
||||||
|
add_custom_target(openssl-build ALL DEPENDS ${OpenSSL_BUILD_LIBRARIES} openssl-configure)
|
||||||
|
|
||||||
|
add_library(SSL INTERFACE)
|
||||||
|
target_include_directories(SSL INTERFACE ${OpenSSL_SOURCE_DIR}/include)
|
||||||
|
target_link_libraries(SSL INTERFACE openssl-build)
|
||||||
|
|
||||||
|
add_library(Crypto INTERFACE)
|
||||||
|
target_include_directories(Crypto INTERFACE ${OpenSSL_SOURCE_DIR}/include)
|
||||||
|
target_link_libraries(Crypto INTERFACE openssl-build)
|
||||||
|
|
||||||
|
add_library(OpenSSL::SSL ALIAS SSL)
|
||||||
|
add_library(OpenSSL::Crypto ALIAS Crypto)
|
||||||
|
|
||||||
|
# evil haxx for httplib https://cmake.org/cmake/help/latest/module/FindOpenSSL.html
|
||||||
|
# fuck httplib
|
||||||
|
set(OpenSSL_FOUND TRUE PARENT_SCOPE)
|
||||||
|
set(OpenSSL_VERSION "4.0.0" PARENT_SCOPE)
|
||||||
|
# Deprecated but some people run older cmake
|
||||||
|
set(OPENSSL_FOUND TRUE PARENT_SCOPE)
|
||||||
|
set(OPENSSL_VERSION "4.0.0" PARENT_SCOPE)
|
||||||
|
|
||||||
|
set(OPENSSL_INCLUDE_DIR ${OpenSSL_SOURCE_DIR}/include PARENT_SCOPE)
|
||||||
|
set(OPENSSL_CRYPTO_LIBRARY ${OpenSSL_BUILD_DIR}/libcrypto.a PARENT_SCOPE)
|
||||||
|
set(OPENSSL_CRYPTO_LIBRARIES ${OpenSSL_BUILD_DIR}/libcrypto.a PARENT_SCOPE)
|
||||||
|
set(OPENSSL_SSL_LIBRARY ${OpenSSL_BUILD_DIR}/libssl.a PARENT_SCOPE)
|
||||||
|
set(OPENSSL_SSL_LIBRARIES ${OpenSSL_BUILD_DIR}/libssl.a PARENT_SCOPE)
|
||||||
|
set(OPENSSL_LIBRARIES "${OpenSSL_BUILD_DIR}/libssl.a;${OpenSSL_BUILD_DIR}/libcrypto.a" PARENT_SCOPE)
|
||||||
|
|
||||||
|
set(OPENSSL_ROOT_DIR ${OpenSSL_BUILD_DIR} PARENT_SCOPE)
|
||||||
|
set(OPENSSL_USE_STATIC_LIBS TRUE PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
@@ -150,13 +150,13 @@ add_library(
|
|||||||
httplib.h
|
httplib.h
|
||||||
net/net.h net/net.cpp)
|
net/net.h net/net.cpp)
|
||||||
|
|
||||||
|
# httplib must be put first otherwise external-openssl builds won't work
|
||||||
|
target_link_libraries(common PUBLIC httplib::httplib)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_sources(common PRIVATE windows/timer_resolution.cpp
|
target_sources(common PRIVATE windows/timer_resolution.cpp
|
||||||
windows/timer_resolution.h)
|
windows/timer_resolution.h)
|
||||||
target_link_libraries(common PRIVATE ntdll)
|
target_link_libraries(common PRIVATE ntdll)
|
||||||
endif()
|
else()
|
||||||
|
|
||||||
if(NOT WIN32)
|
|
||||||
target_sources(common PRIVATE signal_chain.cpp signal_chain.h)
|
target_sources(common PRIVATE signal_chain.cpp signal_chain.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -239,7 +239,7 @@ else()
|
|||||||
target_link_libraries(common PUBLIC Boost::headers)
|
target_link_libraries(common PUBLIC Boost::headers)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(common PUBLIC Boost::filesystem Boost::context httplib::httplib nlohmann_json::nlohmann_json)
|
target_link_libraries(common PUBLIC Boost::filesystem Boost::context nlohmann_json::nlohmann_json)
|
||||||
|
|
||||||
if (lz4_ADDED)
|
if (lz4_ADDED)
|
||||||
target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib)
|
target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib)
|
||||||
|
|||||||
@@ -1206,7 +1206,9 @@ else()
|
|||||||
endif()
|
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)
|
||||||
|
|
||||||
if (BOOST_NO_HEADERS)
|
if (BOOST_NO_HEADERS)
|
||||||
target_link_libraries(core PUBLIC Boost::container Boost::heap Boost::asio Boost::process Boost::crc)
|
target_link_libraries(core PUBLIC Boost::container Boost::heap Boost::asio Boost::process Boost::crc)
|
||||||
@@ -1220,7 +1222,7 @@ target_link_libraries(core PRIVATE
|
|||||||
RenderDoc::API
|
RenderDoc::API
|
||||||
ZLIB::ZLIB)
|
ZLIB::ZLIB)
|
||||||
|
|
||||||
target_link_libraries(core PUBLIC httplib::httplib zstd::zstd)
|
target_link_libraries(core PUBLIC zstd::zstd)
|
||||||
|
|
||||||
if (ENABLE_WEB_SERVICE)
|
if (ENABLE_WEB_SERVICE)
|
||||||
target_compile_definitions(core PUBLIC ENABLE_WEB_SERVICE)
|
target_compile_definitions(core PUBLIC ENABLE_WEB_SERVICE)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ if (USE_DISCORD_PRESENCE)
|
|||||||
discord/discord_impl.cpp
|
discord/discord_impl.cpp
|
||||||
discord/discord_impl.h
|
discord/discord_impl.h
|
||||||
)
|
)
|
||||||
target_link_libraries(qt_common PUBLIC DiscordRPC::discord-rpc httplib::httplib)
|
target_link_libraries(qt_common PUBLIC httplib::httplib DiscordRPC::discord-rpc)
|
||||||
|
|
||||||
if (YUZU_USE_BUNDLED_OPENSSL)
|
if (YUZU_USE_BUNDLED_OPENSSL)
|
||||||
target_link_libraries(qt_common PUBLIC OpenSSL::SSL OpenSSL::Crypto)
|
target_link_libraries(qt_common PUBLIC OpenSSL::SSL OpenSSL::Crypto)
|
||||||
|
|||||||
@@ -331,9 +331,7 @@ endif()
|
|||||||
if (YUZU_USE_EXTERNAL_FFMPEG)
|
if (YUZU_USE_EXTERNAL_FFMPEG)
|
||||||
add_dependencies(video_core ffmpeg-build)
|
add_dependencies(video_core ffmpeg-build)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(video_core PRIVATE ${FFmpeg_INCLUDE_DIR})
|
target_include_directories(video_core PRIVATE ${FFmpeg_INCLUDE_DIR})
|
||||||
|
|
||||||
target_link_libraries(video_core PRIVATE ${FFmpeg_LIBRARIES})
|
target_link_libraries(video_core PRIVATE ${FFmpeg_LIBRARIES})
|
||||||
target_link_options(video_core PRIVATE ${FFmpeg_LDFLAGS})
|
target_link_options(video_core PRIVATE ${FFmpeg_LDFLAGS})
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,5 @@ add_library(web_service STATIC
|
|||||||
|
|
||||||
create_target_directory_groups(web_service)
|
create_target_directory_groups(web_service)
|
||||||
target_include_directories(web_service PUBLIC ${cpp-jwt_SOURCE_DIR}/include)
|
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)
|
target_link_libraries(web_service PRIVATE httplib::httplib common network nlohmann_json::nlohmann_json cpp-jwt::cpp-jwt)
|
||||||
|
|
||||||
find_package(OpenSSL REQUIRED)
|
|
||||||
target_link_libraries(web_service PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
target_link_libraries(web_service PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||||
|
|||||||
Reference in New Issue
Block a user