From a289df140340e879aedfe4b3c08d25467318ea4b Mon Sep 17 00:00:00 2001 From: lizzie Date: Sun, 1 Feb 2026 07:53:50 +0000 Subject: [PATCH] [chore] fix cmake inclusion Signed-off-by: Caio Oliveira --- .patch/unordered-dense/0001-fix-macos.patch | 13 +++++++++++++ CMakeLists.txt | 1 + externals/CMakeLists.txt | 6 +++--- externals/cpmfile.json | 5 ++++- src/common/CMakeLists.txt | 6 +----- src/dynarmic/CMakeLists.txt | 1 + src/dynarmic/src/dynarmic/CMakeLists.txt | 18 ++++-------------- 7 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 .patch/unordered-dense/0001-fix-macos.patch diff --git a/.patch/unordered-dense/0001-fix-macos.patch b/.patch/unordered-dense/0001-fix-macos.patch new file mode 100644 index 0000000000..69d38d0861 --- /dev/null +++ b/.patch/unordered-dense/0001-fix-macos.patch @@ -0,0 +1,13 @@ +diff --git a/include/ankerl/unordered_dense.h b/include/ankerl/unordered_dense.h +index 0835342..5fcc763 100644 +--- a/include/ankerl/unordered_dense.h ++++ b/include/ankerl/unordered_dense.h +@@ -334,7 +334,7 @@ struct hash>> { + using is_avalanching = void; + auto operator()(Enum e) const noexcept -> std::uint64_t { + using underlying = std::underlying_type_t; +- return detail::wyhash::hash(static_cast(e)); ++ return detail::wyhash::hash(uint64_t(underlying(e))); + } + }; + diff --git a/CMakeLists.txt b/CMakeLists.txt index dbe947c1bf..0568a49ec8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -576,6 +576,7 @@ add_subdirectory(externals) # pass targets from externals find_package(enet) find_package(MbedTLS) +find_package(unordered_dense REQUIRED) if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) find_package(xbyak) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 980d8f668d..739cebe2e9 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -66,6 +66,9 @@ if (NOT TARGET LLVM::Demangle) add_library(LLVM::Demangle ALIAS demangle) endif() +# unordered_dense +AddJsonPackage(unordered-dense) + if (YUZU_STATIC_ROOM) return() endif() @@ -244,9 +247,6 @@ if (ENABLE_WEB_SERVICE OR ENABLE_UPDATE_CHECKER) AddJsonPackage(cpp-jwt) endif() -# unordered_dense -AddJsonPackage(unordered-dense) - # FFMpeg if (YUZU_USE_EXTERNAL_FFMPEG OR YUZU_USE_BUNDLED_FFMPEG) add_subdirectory(ffmpeg) diff --git a/externals/cpmfile.json b/externals/cpmfile.json index 7c04e389e2..b4960b5e6a 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -94,7 +94,10 @@ "tag": "v%VERSION%", "hash": "b98b5d4d96f8e0081b184d6c4c1181fae4e41723b54bed4296717d7f417348b48fad0bbcc664cac142b8c8a47e95aa57c1eb1cf6caa855fd782fad3e3ab99e5e", "find_args": "CONFIG", - "git_version": "4.8.1" + "git_version": "4.8.1", + "patches": [ + "0001-fix-macos.patch" + ] }, "mbedtls": { "package": "MbedTLS", diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 25a04d9170..7d299b708e 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -255,11 +255,7 @@ if (lz4_ADDED) target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib) endif() -if (TARGET unordered_dense::unordered_dense) - # weird quirk of system installs - target_link_libraries(common PUBLIC unordered_dense::unordered_dense) -endif() -target_link_libraries(common PUBLIC fmt::fmt stb::headers Threads::Threads) +target_link_libraries(common PUBLIC fmt::fmt stb::headers Threads::Threads unordered_dense::unordered_dense) target_link_libraries(common PRIVATE lz4::lz4 LLVM::Demangle zstd::zstd) if(ANDROID) diff --git a/src/dynarmic/CMakeLists.txt b/src/dynarmic/CMakeLists.txt index fc22f073f7..e0d1f942f0 100644 --- a/src/dynarmic/CMakeLists.txt +++ b/src/dynarmic/CMakeLists.txt @@ -118,6 +118,7 @@ endif() find_package(fmt 8 CONFIG) find_package(mcl 0.1.12 REQUIRED) +find_package(unordered_dense REQUIRED) if ("arm64" IN_LIST ARCHITECTURE OR DYNARMIC_TESTS) find_package(oaknut 2.0.1 CONFIG) diff --git a/src/dynarmic/src/dynarmic/CMakeLists.txt b/src/dynarmic/src/dynarmic/CMakeLists.txt index f2ea9de455..8b55a864a3 100644 --- a/src/dynarmic/src/dynarmic/CMakeLists.txt +++ b/src/dynarmic/src/dynarmic/CMakeLists.txt @@ -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 include(TargetArchitectureSpecificSources) @@ -356,20 +356,10 @@ set_target_properties(dynarmic PROPERTIES SOVERSION ${dynarmic_VERSION_MAJOR}.${dynarmic_VERSION_MINOR} ) -if (TARGET unordered_dense::unordered_dense) - # weird quirk of system installs - target_link_libraries(dynarmic - PRIVATE - unordered_dense::unordered_dense - ) -endif() - target_compile_options(dynarmic PRIVATE ${DYNARMIC_CXX_FLAGS}) -target_link_libraries(dynarmic - PUBLIC - fmt::fmt - merry::mcl -) + +target_link_libraries(dynarmic PRIVATE unordered_dense::unordered_dense) +target_link_libraries(dynarmic PUBLIC fmt::fmt merry::mcl) if (BOOST_NO_HEADERS) target_link_libraries(dynarmic PRIVATE Boost::variant Boost::icl Boost::pool)