Fix most build errors

Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
crueter 2026-03-26 02:53:43 -04:00 committed by lizzie
parent 763ca682b6
commit f7a875e97b
19 changed files with 57 additions and 70 deletions

View file

@ -6,9 +6,9 @@
WORK_DIR="$PWD" WORK_DIR="$PWD"
xcrun --sdk iphoneos --show-sdk-path xcrun --sdk iphoneos --show-sdk-path
# TODO(crueter): FFmpeg for iOS # TODO: support iphonesimulator sdk
cmake -G Xcode -B build \ cmake -G Xcode -B build/ios \
-DCMAKE_TOOLCHAIN_FILE="$WORK_DIR/.ci/ios/ios-toolchain.cmake" \ -DCMAKE_TOOLCHAIN_FILE="$WORK_DIR/.ci/ios/ios-toolchain.cmake" \
-DPLATFORM=OS64 \ -DPLATFORM=OS64 \
-DARCHS="arm64" \ -DARCHS="arm64" \
@ -19,8 +19,7 @@ cmake -G Xcode -B build \
-DENABLE_QT=OFF \ -DENABLE_QT=OFF \
-DENABLE_WEB_SERVICE=OFF \ -DENABLE_WEB_SERVICE=OFF \
-DENABLE_CUBEB=OFF \ -DENABLE_CUBEB=OFF \
-DYUZU_USE_EXTERNAL_FFMPEG=ON \ -DCMAKE_BUILD_TYPE=Release \
-DYUZU_USE_EXTERNAL_SDL2=ON \ "$@"
-DCMAKE_BUILD_TYPE=Release
cmake --build build -t eden-ios cmake --build build/ios -t eden-ios --config Release

View file

@ -157,7 +157,7 @@
# command. # command.
# #
cmake_minimum_required(VERSION 3.8.0) cmake_minimum_required(VERSION 3.10)
# CMake invokes the toolchain file twice during the first build, but only once during subsequent rebuilds. # CMake invokes the toolchain file twice during the first build, but only once during subsequent rebuilds.
# NOTE: To improve single-library build-times, provide the flag "OS_SINGLE_BUILD" as a build argument. # NOTE: To improve single-library build-times, provide the flag "OS_SINGLE_BUILD" as a build argument.

View file

@ -170,24 +170,24 @@ if (MSVC AND NOT CXX_CLANG)
set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} /W3 /WX-") set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} /W3 /WX-")
endif() endif()
# TODO(crueter): Cleanup, each dep that has a bundled option should allow to choose between bundled, external, system
cmake_dependent_option(YUZU_USE_EXTERNAL_SDL2 "Build SDL2 from external source" OFF "NOT MSVC;NOT ANDROID" OFF)
cmake_dependent_option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 build" "${MSVC}" "NOT ANDROID" OFF)
option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
set(EXT_DEFAULT OFF) set(EXT_DEFAULT OFF)
if (MSVC OR ANDROID OR IOS) if (MSVC OR ANDROID OR IOS)
set(EXT_DEFAULT ON) set(EXT_DEFAULT ON)
endif() endif()
# TODO(crueter): Cleanup, each dep that has a bundled option should allow to choose between bundled, external, system
cmake_dependent_option(YUZU_USE_EXTERNAL_SDL2 "Build SDL2 from external source" OFF "NOT MSVC;NOT ANDROID" OFF)
cmake_dependent_option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 build" "${EXT_DEFAULT}" "NOT ANDROID" OFF)
option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
# ffmpeg # ffmpeg
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)
# 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 OR IOS)
set(BUNDLED_SIRIT_DEFAULT ON) set(BUNDLED_SIRIT_DEFAULT ON)
endif() endif()

View file

@ -228,6 +228,10 @@ if (VulkanMemoryAllocator_ADDED)
endif() endif()
# httplib # httplib
if (IOS)
set(HTTPLIB_USE_BROTLI_IF_AVAILABLE OFF)
endif()
AddJsonPackage(httplib) AddJsonPackage(httplib)
# cpp-jwt # cpp-jwt

View file

@ -41,12 +41,12 @@ if (CMAKE_OSX_ARCHITECTURES)
if (IOS) if (IOS)
# TODO: Right... the toolchain file won't properly accomodate OSX_ARCHITECTURE # TODO: Right... the toolchain file won't properly accomodate OSX_ARCHITECTURE
# they aren't defining it as a list properly I assume? # they aren't defining it as a list properly I assume?
set(ARCHITECTURE_arm64 1 PARENT_SCOPE) set(ARCHITECTURE_arm64 1)
add_definitions(-DARCHITECTURE_arm64=1) add_definitions(-DARCHITECTURE_arm64=1)
else () else ()
# hope and pray the architecture names match # hope and pray the architecture names match
foreach(ARCH IN ${CMAKE_OSX_ARCHITECTURES}) foreach(ARCH ${CMAKE_OSX_ARCHITECTURES})
set(ARCHITECTURE_${ARCH} 1 PARENT_SCOPE) set(ARCHITECTURE_${ARCH} 1)
add_definitions(-DARCHITECTURE_${ARCH}=1) add_definitions(-DARCHITECTURE_${ARCH}=1)
endforeach() endforeach()
endif() endif()
@ -223,4 +223,4 @@ if (NOT DEFINED ARCHITECTURE)
add_definitions(-DARCHITECTURE_GENERIC=1) add_definitions(-DARCHITECTURE_GENERIC=1)
endif() endif()
message(STATUS "[DetectArchitecture] Target architecture: ${ARCHITECTURE}") message(STATUS "[DetectArchitecture] Target architecture: ${ARCHITECTURE}")

View file

@ -23,10 +23,7 @@
"package": "sirit", "package": "sirit",
"name": "sirit", "name": "sirit",
"repo": "eden-emulator/sirit", "repo": "eden-emulator/sirit",
"version": "1.0.4", "version": "1.0.5"
"disabled_platforms": [
"ios-aarch64"
]
}, },
"httplib": { "httplib": {
"repo": "yhirose/cpp-httplib", "repo": "yhirose/cpp-httplib",
@ -39,7 +36,8 @@
"0002-fix-zstd.patch" "0002-fix-zstd.patch"
], ],
"options": [ "options": [
"HTTPLIB_REQUIRE_OPENSSL ON" "HTTPLIB_REQUIRE_OPENSSL ON",
"HTTPLIB_DISABLE_MACOSX_AUTOMATIC_ROOT_CERTIFICATES ON"
] ]
}, },
"cpp-jwt": { "cpp-jwt": {

View file

@ -146,7 +146,8 @@ add_library(
zstd_compression.cpp zstd_compression.cpp
zstd_compression.h zstd_compression.h
fs/ryujinx_compat.h fs/ryujinx_compat.cpp fs/ryujinx_compat.h fs/ryujinx_compat.cpp
fs/symlink.h fs/symlink.cpp) fs/symlink.h fs/symlink.cpp
httplib.h)
if(WIN32) if(WIN32)
target_sources(common PRIVATE windows/timer_resolution.cpp target_sources(common PRIVATE windows/timer_resolution.cpp
@ -244,7 +245,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) target_link_libraries(common PUBLIC Boost::filesystem Boost::context httplib::httplib)
if (lz4_ADDED) if (lz4_ADDED)
target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib) target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib)

9
src/common/httplib.h Normal file
View file

@ -0,0 +1,9 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#define CPPHTTPLIB_DISABLE_MACOSX_AUTOMATIC_ROOT_CERTIFICATES
#define CPPHTTPLIB_OPENSSL_SUPPORT
#include <httplib.h>

View file

@ -1273,9 +1273,6 @@ endif()
target_sources(core PRIVATE hle/service/ssl/ssl_backend_openssl.cpp) target_sources(core PRIVATE hle/service/ssl/ssl_backend_openssl.cpp)
target_link_libraries(core PRIVATE OpenSSL::SSL OpenSSL::Crypto) target_link_libraries(core PRIVATE OpenSSL::SSL OpenSSL::Crypto)
if (NOT IOS)
target_compile_definitions(core PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
endif()
# TODO # TODO

View file

@ -15,9 +15,7 @@
#include <fmt/format.h> #include <fmt/format.h>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT #include "common/httplib.h"
#include <httplib.h>
#endif
#include <chrono> #include <chrono>
#include <cstring> #include <cstring>
@ -104,7 +102,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) { 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); LOG_INFO(Service_BCAT, "Downloading image: https://eden-emu.dev{}", url_path);
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
try { try {
httplib::Client cli("https://eden-emu.dev"); httplib::Client cli("https://eden-emu.dev");
cli.set_follow_location(true); cli.set_follow_location(true);
@ -128,7 +125,6 @@ std::vector<u8> DownloadImage(const std::string& url_path, const std::filesystem
} catch (...) { } catch (...) {
LOG_WARNING(Service_BCAT, "Failed to download: {}", url_path); LOG_WARNING(Service_BCAT, "Failed to download: {}", url_path);
} }
#endif
return {}; return {};
} }
@ -233,7 +229,6 @@ void WriteCachedJson(std::string_view json) {
std::optional<std::string> DownloadReleasesJson() { std::optional<std::string> DownloadReleasesJson() {
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
try { try {
httplib::SSLClient cli{"api.github.com", 443}; httplib::SSLClient cli{"api.github.com", 443};
cli.set_connection_timeout(10); cli.set_connection_timeout(10);
@ -255,7 +250,7 @@ std::optional<std::string> DownloadReleasesJson() {
} catch (...) { } catch (...) {
LOG_WARNING(Service_BCAT, " failed to download releases"); LOG_WARNING(Service_BCAT, " failed to download releases");
} }
#endif
return std::nullopt; return std::nullopt;
} }

View file

@ -23,9 +23,6 @@ if (ENABLE_UPDATE_CHECKER)
update_checker.cpp update_checker.cpp
update_checker.h) update_checker.h)
target_link_libraries(frontend_common PRIVATE OpenSSL::SSL OpenSSL::Crypto) target_link_libraries(frontend_common PRIVATE OpenSSL::SSL OpenSSL::Crypto)
if (NOT IOS)
target_compile_definitions(frontend_common PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT)
endif()
endif() endif()
create_target_directory_groups(frontend_common) create_target_directory_groups(frontend_common)

View file

@ -13,7 +13,7 @@
#include "common/scm_rev.h" #include "common/scm_rev.h"
#include "update_checker.h" #include "update_checker.h"
#include <httplib.h> #include "common/httplib.h"
#ifdef YUZU_BUNDLED_OPENSSL #ifdef YUZU_BUNDLED_OPENSSL
#include <openssl/cert.h> #include <openssl/cert.h>

View file

@ -15,6 +15,7 @@ add_executable(eden-ios
EmulationSession.mm EmulationSession.mm
EmulationWindow.h EmulationWindow.h
EmulationWindow.mm EmulationWindow.mm
VMA.cpp
) )
# Keep bundle identifier as-is, for compatibility sake # Keep bundle identifier as-is, for compatibility sake
set_target_properties(eden-ios PROPERTIES set_target_properties(eden-ios PROPERTIES
@ -26,5 +27,5 @@ set_target_properties(eden-ios PROPERTIES
) )
target_link_libraries(eden-ios PRIVATE common core input_common frontend_common video_core sirit::sirit) target_link_libraries(eden-ios PRIVATE common core input_common frontend_common video_core sirit::sirit)
target_link_libraries(eden-ios PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) target_link_libraries(eden-ios PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
target_link_libraries(eden-ios PRIVATE SDL2::SDL2 glad) target_link_libraries(eden-ios PRIVATE SDL2::SDL2 glad stb::headers)
create_target_directory_groups(eden-ios) create_target_directory_groups(eden-ios)

5
src/ios/VMA.cpp Normal file
View file

@ -0,0 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#define VMA_IMPLEMENTATION
#include "video_core/vulkan_common/vma.h"

View file

@ -50,9 +50,6 @@ if (USE_DISCORD_PRESENCE)
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)
if (NOT IOS)
target_compile_definitions(qt_common PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
endif()
endif() endif()
target_compile_definitions(qt_common PUBLIC USE_DISCORD_PRESENCE) target_compile_definitions(qt_common PUBLIC USE_DISCORD_PRESENCE)

View file

@ -9,7 +9,7 @@
#include <QEventLoop> #include <QEventLoop>
#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/replace.hpp>
#include <httplib.h> #include "common/httplib.h"
#include <discord_rpc.h> #include <discord_rpc.h>
#include <fmt/format.h> #include <fmt/format.h>

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project // SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -13,9 +13,14 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning( push ) #pragma warning( push )
#pragma warning( disable : 4189 ) #pragma warning( disable : 4189 )
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable"
#endif #endif
#include "vk_mem_alloc.h" #include "vk_mem_alloc.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning( pop ) #pragma warning( pop )
#elif defined(__clang__)
#pragma clang diagnostic pop
#endif #endif

View file

@ -20,27 +20,6 @@ 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 common network nlohmann_json::nlohmann_json httplib::httplib cpp-jwt::cpp-jwt)
if (IOS) find_package(OpenSSL REQUIRED)
# TODO: this is horrific target_link_libraries(web_service PRIVATE OpenSSL::SSL OpenSSL::Crypto)
find_package(OpenSSL 3 QUIET) target_compile_definitions(web_service PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
if (OpenSSL_FOUND)
target_link_libraries(web_service PRIVATE OpenSSL::SSL OpenSSL::Crypto)
if (NOT IOS)
target_compile_definitions(web_service PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
endif()
else()
find_package(OpenSSL 3 QUIET PATHS /usr/local/opt/openssl /opt/homebrew/opt/openssl NO_DEFAULT_PATH)
if (OpenSSL_FOUND)
target_link_libraries(web_service PRIVATE OpenSSL::SSL OpenSSL::Crypto)
if (NOT IOS)
target_compile_definitions(web_service PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
endif()
else()
message(WARNING "OpenSSL not found or version is less than 3. Some features in web_service may be disabled.")
endif()
endif()
else()
find_package(OpenSSL REQUIRED)
target_link_libraries(web_service PRIVATE OpenSSL::SSL OpenSSL::Crypto)
target_compile_definitions(web_service PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
endif()

View file

@ -16,7 +16,7 @@
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif #endif
#endif #endif
#include <httplib.h> #include "common/httplib.h"
#ifdef __GNUC__ #ifdef __GNUC__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif