From 4c0090cd74a45c91d0721552bd7005556a73e3bb Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 3 Oct 2025 23:07:40 -0400 Subject: [PATCH 1/2] [cmake] proper link to Boost::context Signed-off-by: crueter --- CMakeLists.txt | 36 +++++++++++++++++++++++++++--------- src/common/CMakeLists.txt | 4 ++++ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9ff2e9458..9e3c9153dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,6 +147,7 @@ if (ENABLE_SDL2) option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 build" "${MSVC}") endif() +# qt stuff option(ENABLE_QT "Enable the Qt frontend" ON) option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF) option(ENABLE_QT_UPDATE_CHECKER "Enable update checker for the Qt frontend" OFF) @@ -163,9 +164,13 @@ if (MSVC OR ANDROID) endif() option(YUZU_USE_CPM "Use CPM to fetch system dependencies (fmt, boost, etc) if needed. Externals will still be fetched." ${EXT_DEFAULT}) +# ffmpeg option(YUZU_USE_BUNDLED_FFMPEG "Download bundled FFmpeg" ${EXT_DEFAULT}) cmake_dependent_option(YUZU_USE_EXTERNAL_FFMPEG "Build FFmpeg from source" OFF "NOT WIN32 AND NOT ANDROID" OFF) +# sirit +option(YUZU_USE_BUNDLED_SIRIT "Download bundled sirit" ${EXT_DEFAULT}) + cmake_dependent_option(ENABLE_LIBUSB "Enable the use of LibUSB" ON "NOT ANDROID" OFF) cmake_dependent_option(ENABLE_OPENGL "Enable OpenGL" ON "NOT WIN32 OR NOT ARCHITECTURE_arm64" OFF) @@ -312,7 +317,6 @@ endif() if (ARCHITECTURE_arm64 AND (ANDROID OR PLATFORM_LINUX)) set(HAS_NCE 1) add_compile_definitions(HAS_NCE=1) - find_package(oaknut 2.0.1) endif() if (YUZU_ROOM) @@ -423,6 +427,8 @@ if (YUZU_USE_CPM) target_compile_options(boost_icl INTERFACE -Wno-shadow) target_compile_options(boost_asio INTERFACE -Wno-conversion -Wno-implicit-fallthrough) endif() + elseif (PLATFORM_LINUX) + find_package(Boost 1.57.0 REQUIRED headers context system fiber) endif() # fmt @@ -492,7 +498,22 @@ if (YUZU_USE_CPM) endif() # SPIRV Headers - AddJsonPackage(spirv-headers) + + # We only need SPIRV-Headers iff spirv-tools is bundled + if (SPIRV-Tools_FORCE_BUNDLED OR CPMUTIL_FORCE_BUNDLED) + set(NEED_SPIRV_HEADERS ON) + else() + find_package(SPIRV-Tools MODULE QUIET) + if (NOT SPIRV-Tools_FOUND) + set(NEED_SPIRV_HEADERS ON) + else() + set(NEED_SPIRV_HEADERS OFF) + endif() + endif() + + if (NEED_SPIRV_HEADERS) + AddJsonPackage(spirv-headers) + endif() # SPIRV Tools AddJsonPackage(spirv-tools) @@ -537,13 +558,6 @@ else() find_package(VulkanUtilityLibraries REQUIRED) find_package(VulkanHeaders 1.3.274 REQUIRED) - # FreeBSD does not package spirv-headers - if (PLATFORM_FREEBSD) - AddJsonPackage(spirv-headers) - else() - find_package(SPIRV-Headers 1.3.274 REQUIRED) - endif() - find_package(SPIRV-Tools MODULE REQUIRED) if (YUZU_TESTS) @@ -690,6 +704,10 @@ if (ENABLE_WEB_SERVICE OR ENABLE_QT_UPDATE_CHECKER) find_package(cpp-jwt) endif() +if (ARCHITECTURE_arm64 OR DYNARMIC_TESTS) + find_package(oaknut) +endif() + if (ENABLE_QT) if (YUZU_USE_BUNDLED_QT) download_qt(6.8.3) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 96ea429e5a..f0d7ccca70 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -260,6 +260,10 @@ else() target_link_libraries(common PUBLIC Boost::headers) endif() +if (TARGET Boost::context) + target_link_libraries(common PUBLIC Boost::context) +endif() + if (lz4_ADDED) target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib) endif() From 4560f025e10db7471f5857b0ecabf787f90b12e0 Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 3 Oct 2025 23:07:40 -0400 Subject: [PATCH 2/2] [cmake] proper link to Boost::context Signed-off-by: crueter --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9ff2e9458..9e5e3fdf92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -423,6 +423,8 @@ if (YUZU_USE_CPM) target_compile_options(boost_icl INTERFACE -Wno-shadow) target_compile_options(boost_asio INTERFACE -Wno-conversion -Wno-implicit-fallthrough) endif() + elseif (PLATFORM_LINUX OR APPLE) + find_package(Boost 1.57.0 REQUIRED headers context system fiber) endif() # fmt @@ -521,7 +523,7 @@ else() find_package(zstd 1.5 REQUIRED MODULE) # wow - if (PLATFORM_LINUX) + if (PLATFORM_LINUX OR APPLE) find_package(Boost 1.57.0 REQUIRED headers context system fiber) else() find_package(Boost 1.57.0 REQUIRED)