aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--externals/CMakeLists.txt9
-rw-r--r--externals/cpmfile.json3
-rw-r--r--src/common/CMakeLists.txt5
-rw-r--r--src/common/httplib.h18
-rw-r--r--src/core/CMakeLists.txt1
-rw-r--r--src/core/hle/service/bcat/news/builtin_news.cpp11
-rw-r--r--src/frontend_common/CMakeLists.txt2
-rw-r--r--src/frontend_common/update_checker.cpp2
-rw-r--r--src/qt_common/CMakeLists.txt1
-rw-r--r--src/qt_common/discord/discord_impl.cpp2
-rw-r--r--src/web_service/CMakeLists.txt4
-rw-r--r--src/web_service/web_backend.cpp12
12 files changed, 36 insertions, 34 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index 00bdf10a4f..ba0545b7a7 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -62,6 +62,12 @@ endif()
# unordered_dense
AddJsonPackage(unordered-dense)
+# httplib
+if (IOS)
+ set(HTTPLIB_USE_BROTLI_IF_AVAILABLE OFF)
+endif()
+AddJsonPackage(httplib)
+
if (YUZU_STATIC_ROOM)
return()
endif()
@@ -227,9 +233,6 @@ if (VulkanMemoryAllocator_ADDED)
endif()
endif()
-# httplib
-AddJsonPackage(httplib)
-
# cpp-jwt
if (ENABLE_WEB_SERVICE OR ENABLE_UPDATE_CHECKER)
AddJsonPackage(cpp-jwt)
diff --git a/externals/cpmfile.json b/externals/cpmfile.json
index f849426a4d..03303a5896 100644
--- a/externals/cpmfile.json
+++ b/externals/cpmfile.json
@@ -36,7 +36,8 @@
"0002-fix-zstd.patch"
],
"options": [
- "HTTPLIB_REQUIRE_OPENSSL ON"
+ "HTTPLIB_REQUIRE_OPENSSL ON",
+ "HTTPLIB_DISABLE_MACOSX_AUTOMATIC_ROOT_CERTIFICATES ON"
]
},
"cpp-jwt": {
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 98c1688441..2846058df9 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -146,7 +146,8 @@ add_library(
zstd_compression.cpp
zstd_compression.h
fs/ryujinx_compat.h fs/ryujinx_compat.cpp
- fs/symlink.h fs/symlink.cpp)
+ fs/symlink.h fs/symlink.cpp
+ httplib.h)
if(WIN32)
target_sources(common PRIVATE windows/timer_resolution.cpp
@@ -244,7 +245,7 @@ else()
target_link_libraries(common PUBLIC Boost::headers)
endif()
-target_link_libraries(common PUBLIC Boost::filesystem Boost::context)
+target_link_libraries(common PUBLIC Boost::filesystem Boost::context httplib::httplib)
if (lz4_ADDED)
target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib)
diff --git a/src/common/httplib.h b/src/common/httplib.h
new file mode 100644
index 0000000000..57bc4eeb93
--- /dev/null
+++ b/src/common/httplib.h
@@ -0,0 +1,18 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#pragma once
+
+#define CPPHTTPLIB_DISABLE_MACOSX_AUTOMATIC_ROOT_CERTIFICATES 1
+#define CPPHTTPLIB_OPENSSL_SUPPORT 1
+
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#ifndef __clang__
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
+#endif
+#include <httplib.h>
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 04a46dd6dc..39aebd5f48 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -1269,7 +1269,6 @@ endif()
target_sources(core PRIVATE hle/service/ssl/ssl_backend_openssl.cpp)
target_link_libraries(core PRIVATE OpenSSL::SSL OpenSSL::Crypto)
-target_compile_definitions(core PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
# TODO
diff --git a/src/core/hle/service/bcat/news/builtin_news.cpp b/src/core/hle/service/bcat/news/builtin_news.cpp
index ed001b056b..d24431cdbc 100644
--- a/src/core/hle/service/bcat/news/builtin_news.cpp
+++ b/src/core/hle/service/bcat/news/builtin_news.cpp
@@ -15,9 +15,7 @@
#include <fmt/format.h>
#include <nlohmann/json.hpp>
-#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
-#include <httplib.h>
-#endif
+#include "common/httplib.h"
#include <chrono>
#include <cstring>
@@ -103,8 +101,6 @@ std::vector<u8> TryLoadFromDisk(const std::filesystem::path& path) {
std::vector<u8> DownloadImage(const std::string& url_path, const std::filesystem::path& cache_path) {
LOG_INFO(Service_BCAT, "Downloading image: https://eden-emu.dev{}", url_path);
-
-#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
try {
httplib::Client cli("https://eden-emu.dev");
cli.set_follow_location(true);
@@ -128,8 +124,6 @@ std::vector<u8> DownloadImage(const std::string& url_path, const std::filesystem
} catch (...) {
LOG_WARNING(Service_BCAT, "Failed to download: {}", url_path);
}
-#endif
-
return {};
}
@@ -232,8 +226,6 @@ void WriteCachedJson(std::string_view json) {
}
std::optional<std::string> DownloadReleasesJson() {
-
-#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
try {
httplib::SSLClient cli{"api.github.com", 443};
cli.set_connection_timeout(10);
@@ -255,7 +247,6 @@ std::optional<std::string> DownloadReleasesJson() {
} catch (...) {
LOG_WARNING(Service_BCAT, " failed to download releases");
}
-#endif
return std::nullopt;
}
diff --git a/src/frontend_common/CMakeLists.txt b/src/frontend_common/CMakeLists.txt
index a6d580cb18..f9b3805939 100644
--- a/src/frontend_common/CMakeLists.txt
+++ b/src/frontend_common/CMakeLists.txt
@@ -22,8 +22,6 @@ if (ENABLE_UPDATE_CHECKER)
target_sources(frontend_common PRIVATE
update_checker.cpp
update_checker.h)
-
- target_compile_definitions(frontend_common PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT)
target_link_libraries(frontend_common PRIVATE OpenSSL::SSL OpenSSL::Crypto)
endif()
diff --git a/src/frontend_common/update_checker.cpp b/src/frontend_common/update_checker.cpp
index 75b1dc00cc..3e5a832ba0 100644
--- a/src/frontend_common/update_checker.cpp
+++ b/src/frontend_common/update_checker.cpp
@@ -13,7 +13,7 @@
#include "common/scm_rev.h"
#include "update_checker.h"
-#include <httplib.h>
+#include "common/httplib.h"
#ifdef YUZU_BUNDLED_OPENSSL
#include <openssl/cert.h>
diff --git a/src/qt_common/CMakeLists.txt b/src/qt_common/CMakeLists.txt
index 904b03d288..399fbe67a0 100644
--- a/src/qt_common/CMakeLists.txt
+++ b/src/qt_common/CMakeLists.txt
@@ -50,7 +50,6 @@ if (USE_DISCORD_PRESENCE)
if (YUZU_USE_BUNDLED_OPENSSL)
target_link_libraries(qt_common PUBLIC OpenSSL::SSL OpenSSL::Crypto)
- target_compile_definitions(qt_common PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
endif()
target_compile_definitions(qt_common PUBLIC USE_DISCORD_PRESENCE)
diff --git a/src/qt_common/discord/discord_impl.cpp b/src/qt_common/discord/discord_impl.cpp
index 37b24cdd57..c1cb5319dc 100644
--- a/src/qt_common/discord/discord_impl.cpp
+++ b/src/qt_common/discord/discord_impl.cpp
@@ -9,7 +9,7 @@
#include <QEventLoop>
#include <boost/algorithm/string/replace.hpp>
-#include <httplib.h>
+#include "common/httplib.h"
#include <discord_rpc.h>
#include <fmt/format.h>
diff --git a/src/web_service/CMakeLists.txt b/src/web_service/CMakeLists.txt
index 0dedad16f7..d4debb3c09 100644
--- a/src/web_service/CMakeLists.txt
+++ b/src/web_service/CMakeLists.txt
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+# SPDX-License-Identifier: GPL-3.0-or-later
+
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
@@ -19,4 +22,3 @@ target_link_libraries(web_service PRIVATE common network nlohmann_json::nlohmann
find_package(OpenSSL REQUIRED)
target_link_libraries(web_service PRIVATE OpenSSL::SSL OpenSSL::Crypto)
-target_compile_definitions(web_service PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp
index 60b11fff5a..7fc2ae69b1 100644
--- a/src/web_service/web_backend.cpp
+++ b/src/web_service/web_backend.cpp
@@ -9,17 +9,7 @@
#include <string>
#include <fmt/ranges.h>
-
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#ifndef __clang__
-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#endif
-#endif
-#include <httplib.h>
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
+#include "common/httplib.h"
#ifdef YUZU_BUNDLED_OPENSSL
#include <openssl/cert.h>