mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-26 05:09:01 +02:00
[cmake] CPMUtil: formatting, git_host, new repos, more system deps, libusb (#392)
I promise I'm a UI developer - mbedtls can now be used as a system package - zycore can now be used as a system package - cleaned up dynarmic externals - fixed libusb incorrectly showing as bundled - add version/tag formatting to JSON - add custom GIT_HOST option for packages - moved some of my repos to my new git - slightly better version identification - combined VUL/VH since they are codependent (using my combo vendor) - fix cpmfile inclusion - remove libusb submodule This PR succeeds #383 since it includes it Co-authored-by: SDK Chan <sdkchan@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/392 Co-authored-by: crueter <crueter@crueter.xyz> Co-committed-by: crueter <crueter@crueter.xyz>
This commit is contained in:
parent
ecc99ce9ab
commit
428f136a75
39 changed files with 921 additions and 904 deletions
|
|
@ -1,3 +1,6 @@
|
|||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(dynarmic LANGUAGES C CXX ASM VERSION 6.7.0)
|
||||
|
||||
|
|
@ -147,28 +150,26 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# Forced use of individual bundled libraries for non-REQUIRED library is possible with e.g. cmake -DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON ...
|
||||
|
||||
if (DYNARMIC_USE_BUNDLED_EXTERNALS)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_biscuit ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_fmt ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_mcl ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_oaknut ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_unordered_dense ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_xbyak ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_Zydis ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_Zycore ON)
|
||||
endif()
|
||||
|
||||
find_package(Boost 1.57 REQUIRED)
|
||||
find_package(fmt 9 CONFIG)
|
||||
|
||||
# Pull in externals CMakeLists for libs where available
|
||||
add_subdirectory(externals)
|
||||
|
||||
find_package(mcl 0.1.12 REQUIRED)
|
||||
|
||||
if ("arm64" IN_LIST ARCHITECTURE OR DYNARMIC_TESTS)
|
||||
find_package(oaknut 2.0.1 CONFIG)
|
||||
endif()
|
||||
|
||||
if ("riscv" IN_LIST ARCHITECTURE)
|
||||
find_package(biscuit 0.9.1 REQUIRED)
|
||||
endif()
|
||||
|
||||
if ("x86_64" IN_LIST ARCHITECTURE)
|
||||
find_package(xbyak 7 CONFIG)
|
||||
find_package(zycore REQUIRED)
|
||||
find_package(zydis 4 REQUIRED)
|
||||
endif()
|
||||
|
||||
if (DYNARMIC_USE_LLVM)
|
||||
|
|
@ -183,9 +184,6 @@ if (DYNARMIC_TESTS)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# Pull in externals CMakeLists for libs where available
|
||||
add_subdirectory(externals)
|
||||
|
||||
# Dynarmic project files
|
||||
add_subdirectory(src/dynarmic)
|
||||
if (DYNARMIC_TESTS)
|
||||
|
|
|
|||
50
src/dynarmic/externals/CMakeLists.txt
vendored
50
src/dynarmic/externals/CMakeLists.txt
vendored
|
|
@ -1,5 +1,6 @@
|
|||
# Explicitly include CPMUtil here since we have a separate cpmfile for dynarmic
|
||||
set(CPMUTIL_JSON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json)
|
||||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
include(CPMUtil)
|
||||
|
||||
# Always build externals as static libraries, even when dynarmic is built as shared
|
||||
|
|
@ -20,62 +21,25 @@ set(BUILD_TESTING OFF)
|
|||
# biscuit
|
||||
|
||||
if ("riscv" IN_LIST ARCHITECTURE)
|
||||
add_subdirectory(biscuit)
|
||||
|
||||
AddJsonPackage(
|
||||
NAME biscuit
|
||||
BUNDLED_PACKAGE ${DYNARMIC_USE_BUNDLED_EXTERNALS}
|
||||
)
|
||||
endif()
|
||||
|
||||
# catch
|
||||
|
||||
# if (NOT TARGET Catch2::Catch2WithMain)
|
||||
# if (DYNARMIC_TESTS)
|
||||
# find_package(Catch2 3.0.1 REQUIRED)
|
||||
# endif()
|
||||
# endif()
|
||||
|
||||
# fmt
|
||||
|
||||
# if (NOT TARGET fmt::fmt)
|
||||
# # fmtlib formatting library
|
||||
# set(FMT_INSTALL ON)
|
||||
# add_subdirectory(fmt)
|
||||
# endif()
|
||||
|
||||
# mcl
|
||||
AddJsonPackage(
|
||||
NAME mcl
|
||||
BUNDLED_PACKAGE ${DYNARMIC_USE_BUNDLED_EXTERNALS}
|
||||
)
|
||||
|
||||
# oaknut
|
||||
|
||||
# if (NOT TARGET merry::oaknut)
|
||||
# if ("arm64" IN_LIST ARCHITECTURE)
|
||||
# add_subdirectory(oaknut)
|
||||
# elseif (DYNARMIC_TESTS)
|
||||
# add_subdirectory(oaknut EXCLUDE_FROM_ALL)
|
||||
# endif()
|
||||
# endif()
|
||||
|
||||
# xbyak
|
||||
# uncomment if in an independent repo
|
||||
|
||||
# if (NOT TARGET xbyak::xbyak)
|
||||
# if ("x86_64" IN_LIST ARCHITECTURE)
|
||||
# add_subdirectory(xbyak)
|
||||
# endif()
|
||||
# endif()
|
||||
|
||||
# zydis
|
||||
|
||||
# TODO(crueter): maybe it's just Gentoo but zydis system package really sucks
|
||||
if ("x86_64" IN_LIST ARCHITECTURE)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_Doxygen ON)
|
||||
# TODO(crueter): system zycore doesn't work with zydis
|
||||
AddJsonPackage(zycore)
|
||||
AddJsonPackage(
|
||||
NAME zycore
|
||||
BUNDLED_PACKAGE ${DYNARMIC_USE_BUNDLED_EXTERNALS}
|
||||
)
|
||||
|
||||
AddJsonPackage(
|
||||
NAME zydis
|
||||
|
|
|
|||
7
src/dynarmic/externals/cpmfile.json
vendored
7
src/dynarmic/externals/cpmfile.json
vendored
|
|
@ -15,14 +15,13 @@
|
|||
]
|
||||
},
|
||||
"zycore": {
|
||||
"package": "Zycore",
|
||||
"package": "zycore",
|
||||
"repo": "zyantific/zycore-c",
|
||||
"sha": "75a36c45ae",
|
||||
"hash": "15aa399f39713e042c4345bc3175c82f14dca849fde2a21d4f591f62c43e227b70d868d8bb86beb5f4eb68b1d6bd3792cdd638acf89009e787e3d10ee7401924",
|
||||
"bundled": true
|
||||
"hash": "15aa399f39713e042c4345bc3175c82f14dca849fde2a21d4f591f62c43e227b70d868d8bb86beb5f4eb68b1d6bd3792cdd638acf89009e787e3d10ee7401924"
|
||||
},
|
||||
"zydis": {
|
||||
"package": "Zydis",
|
||||
"package": "zydis",
|
||||
"version": "4",
|
||||
"repo": "zyantific/zydis",
|
||||
"sha": "c2d2bab025",
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ if ("x86_64" IN_LIST ARCHITECTURE)
|
|||
target_link_libraries(dynarmic
|
||||
PRIVATE
|
||||
xbyak::xbyak
|
||||
Zydis
|
||||
Zydis::Zydis
|
||||
)
|
||||
|
||||
target_architecture_specific_sources(dynarmic "x86_64"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue