[cmake] CPMUtil: formatting, git_host, and more
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) This PR succeeds #383 since it includes it Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
3fd024a8c9
commit
88407ad7af
17 changed files with 176 additions and 165 deletions
|
@ -73,8 +73,7 @@ option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
|
|||
option(ENABLE_WIFI_SCAN "Enable WiFi scanning" OFF)
|
||||
|
||||
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" ${EXT_DEFAULT})
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ${EXT_DEFAULT})
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan-Utility-Libraries from externals" ${EXT_DEFAULT})
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan Utility Headers from externals" ${EXT_DEFAULT})
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS "Use SPIRV-Tools from externals" ${EXT_DEFAULT})
|
||||
|
||||
option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF)
|
||||
|
@ -111,8 +110,6 @@ CMAKE_DEPENDENT_OPTION(YUZU_CMD "Compile the eden-cli executable" ON "ENABLE_SDL
|
|||
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF)
|
||||
|
||||
option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ${EXT_DEFAULT})
|
||||
|
||||
option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF)
|
||||
|
||||
option(YUZU_DOWNLOAD_TIME_ZONE_DATA "Always download time zone binaries" ON)
|
||||
|
@ -194,53 +191,6 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/hooks/pre-commit AND NOT EXISTS ${PROJECT_SOURCE
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# Sanity check : Check that all submodules are present
|
||||
# =======================================================================
|
||||
|
||||
function(check_submodules_present)
|
||||
file(READ "${PROJECT_SOURCE_DIR}/.gitmodules" gitmodules)
|
||||
string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules})
|
||||
foreach(module ${gitmodules})
|
||||
string(REGEX REPLACE "path *= *" "" module ${module})
|
||||
|
||||
file(GLOB RESULT "${PROJECT_SOURCE_DIR}/${module}/*")
|
||||
list(LENGTH RESULT RES_LEN)
|
||||
if(RES_LEN EQUAL 0)
|
||||
message(FATAL_ERROR "Git submodule ${module} not found. "
|
||||
"Please run: \ngit submodule update --init --recursive")
|
||||
endif()
|
||||
if (EXISTS "${PROJECT_SOURCE_DIR}/${module}/.git")
|
||||
set(SUBMODULE_DIR "${PROJECT_SOURCE_DIR}/${module}")
|
||||
|
||||
execute_process(
|
||||
COMMAND git rev-parse --short=10 HEAD
|
||||
WORKING_DIRECTORY ${SUBMODULE_DIR}
|
||||
OUTPUT_VARIABLE SUBMODULE_SHA
|
||||
)
|
||||
|
||||
# would probably be better to do string parsing, but whatever
|
||||
execute_process(
|
||||
COMMAND git remote get-url origin
|
||||
WORKING_DIRECTORY ${SUBMODULE_DIR}
|
||||
OUTPUT_VARIABLE SUBMODULE_URL
|
||||
)
|
||||
|
||||
string(REGEX REPLACE "\n|\r" "" SUBMODULE_SHA ${SUBMODULE_SHA})
|
||||
string(REGEX REPLACE "\n|\r|\\.git" "" SUBMODULE_URL ${SUBMODULE_URL})
|
||||
|
||||
get_filename_component(SUBMODULE_NAME ${SUBMODULE_DIR} NAME)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_NAMES ${SUBMODULE_NAME})
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_SHAS ${SUBMODULE_SHA})
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_URLS ${SUBMODULE_URL})
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/.gitmodules AND YUZU_CHECK_SUBMODULES)
|
||||
check_submodules_present()
|
||||
endif()
|
||||
|
||||
configure_file(${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.qrc
|
||||
${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc
|
||||
COPYONLY)
|
||||
|
@ -601,7 +551,6 @@ endfunction()
|
|||
add_subdirectory(externals)
|
||||
|
||||
# pass targets from externals
|
||||
find_package(VulkanHeaders)
|
||||
find_package(VulkanUtilityLibraries)
|
||||
find_package(VulkanMemoryAllocator)
|
||||
find_package(SPIRV-Tools)
|
||||
|
|
|
@ -149,11 +149,32 @@ function(AddJsonPackage)
|
|||
get_json_element("${object}" tag tag "")
|
||||
get_json_element("${object}" artifact artifact "")
|
||||
get_json_element("${object}" git_version git_version "")
|
||||
get_json_element("${object}" git_host git_host "")
|
||||
get_json_element("${object}" source_subdir source_subdir "")
|
||||
get_json_element("${object}" bundled bundled "unset")
|
||||
get_json_element("${object}" find_args find_args "")
|
||||
get_json_element("${object}" raw_patches patches "")
|
||||
|
||||
# okay here comes the fun part: REPLACEMENTS!
|
||||
# first: tag gets %VERSION% replaced if applicable, with either git_version (preferred) or version
|
||||
# second: artifact gets %VERSION% and %TAG% replaced accordingly (same rules for VERSION)
|
||||
|
||||
if (git_version)
|
||||
set(version_replace ${git_version})
|
||||
else()
|
||||
set(version_replace ${version})
|
||||
endif()
|
||||
|
||||
# TODO(crueter): fmt module for cmake
|
||||
if (tag)
|
||||
string(REPLACE "%VERSION%" "${version_replace}" tag ${tag})
|
||||
endif()
|
||||
|
||||
if (artifact)
|
||||
string(REPLACE "%VERSION%" "${version_replace}" artifact ${artifact})
|
||||
string(REPLACE "%TAG%" "${tag}" artifact ${artifact})
|
||||
endif()
|
||||
|
||||
# format patchdir
|
||||
if (raw_patches)
|
||||
math(EXPR range "${raw_patches_LENGTH} - 1")
|
||||
|
@ -202,6 +223,8 @@ function(AddJsonPackage)
|
|||
SOURCE_SUBDIR "${source_subdir}"
|
||||
|
||||
GIT_VERSION ${git_version}
|
||||
GIT_HOST ${git_host}
|
||||
|
||||
ARTIFACT ${artifact}
|
||||
TAG ${tag}
|
||||
)
|
||||
|
@ -241,6 +264,7 @@ function(AddPackage)
|
|||
NAME
|
||||
VERSION
|
||||
GIT_VERSION
|
||||
GIT_HOST
|
||||
|
||||
REPO
|
||||
TAG
|
||||
|
@ -273,11 +297,17 @@ function(AddPackage)
|
|||
option(${PKG_ARGS_NAME}_FORCE_SYSTEM "Force the system package for ${PKG_ARGS_NAME}")
|
||||
option(${PKG_ARGS_NAME}_FORCE_BUNDLED "Force the bundled package for ${PKG_ARGS_NAME}")
|
||||
|
||||
if (NOT DEFINED PKG_ARGS_GIT_HOST)
|
||||
set(git_host github.com)
|
||||
else()
|
||||
set(git_host ${PKG_ARGS_GIT_HOST})
|
||||
endif()
|
||||
|
||||
if (DEFINED PKG_ARGS_URL)
|
||||
set(pkg_url ${PKG_ARGS_URL})
|
||||
|
||||
if (DEFINED PKG_ARGS_REPO)
|
||||
set(pkg_git_url https://github.com/${PKG_ARGS_REPO})
|
||||
set(pkg_git_url https://${git_host}/${PKG_ARGS_REPO})
|
||||
else()
|
||||
if (DEFINED PKG_ARGS_GIT_URL)
|
||||
set(pkg_git_url ${PKG_ARGS_GIT_URL})
|
||||
|
@ -286,7 +316,7 @@ function(AddPackage)
|
|||
endif()
|
||||
endif()
|
||||
elseif (DEFINED PKG_ARGS_REPO)
|
||||
set(pkg_git_url https://github.com/${PKG_ARGS_REPO})
|
||||
set(pkg_git_url https://${git_host}/${PKG_ARGS_REPO})
|
||||
|
||||
if (DEFINED PKG_ARGS_TAG)
|
||||
set(pkg_key ${PKG_ARGS_TAG})
|
||||
|
@ -317,25 +347,23 @@ function(AddPackage)
|
|||
|
||||
cpm_utils_message(STATUS ${PKG_ARGS_NAME} "Download URL is ${pkg_url}")
|
||||
|
||||
if (DEFINED PKG_ARGS_GIT_VERSION)
|
||||
set(git_version ${PKG_ARGS_GIT_VERSION})
|
||||
elseif(DEFINED PKG_ARGS_VERSION)
|
||||
set(git_version ${PKG_ARGS_VERSION})
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED PKG_ARGS_KEY)
|
||||
if (DEFINED PKG_ARGS_SHA)
|
||||
string(SUBSTRING ${PKG_ARGS_SHA} 0 4 pkg_key)
|
||||
cpm_utils_message(DEBUG ${PKG_ARGS_NAME}
|
||||
"No custom key defined, using ${pkg_key} from sha")
|
||||
elseif (DEFINED git_version)
|
||||
set(pkg_key ${git_version})
|
||||
elseif(DEFINED PKG_ARGS_GIT_VERSION)
|
||||
set(pkg_key ${PKG_ARGS_GIT_VERSION})
|
||||
cpm_utils_message(DEBUG ${PKG_ARGS_NAME}
|
||||
"No custom key defined, using ${pkg_key}")
|
||||
elseif (DEFINED PKG_ARGS_TAG)
|
||||
set(pkg_key ${PKG_ARGS_TAG})
|
||||
cpm_utils_message(DEBUG ${PKG_ARGS_NAME}
|
||||
"No custom key defined, using ${pkg_key}")
|
||||
elseif (DEFINED PKG_ARGS_VERSION)
|
||||
set(pkg_key ${PKG_ARGS_VERSION})
|
||||
cpm_utils_message(DEBUG ${PKG_ARGS_NAME}
|
||||
"No custom key defined, using ${pkg_key}")
|
||||
else()
|
||||
cpm_utils_message(WARNING ${PKG_ARGS_NAME}
|
||||
"Could not determine cache key, using CPM defaults")
|
||||
|
@ -446,12 +474,15 @@ function(AddPackage)
|
|||
if (DEFINED PKG_ARGS_SHA)
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_SHAS
|
||||
${PKG_ARGS_SHA})
|
||||
elseif(DEFINED git_version)
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_SHAS
|
||||
${git_version})
|
||||
elseif (DEFINED PKG_ARGS_GIT_VERSION)
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_SHAS
|
||||
${PKG_ARGS_GIT_VERSION})
|
||||
elseif (DEFINED PKG_ARGS_TAG)
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_SHAS
|
||||
${PKG_ARGS_TAG})
|
||||
elseif(DEFINED PKG_ARGS_VERSION)
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_SHAS
|
||||
${PKG_ARGS_VERSION})
|
||||
else()
|
||||
cpm_utils_message(WARNING ${PKG_ARGS_NAME}
|
||||
"Package has no specified sha, tag, or version")
|
||||
|
@ -496,6 +527,7 @@ function(add_ci_package key)
|
|||
set(ARTIFACT_DIR ${${ARTIFACT_PACKAGE}_SOURCE_DIR} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# TODO(crueter): we could do an AddMultiArchPackage, multiplatformpackage?
|
||||
# name is the artifact name, package is for find_package override
|
||||
function(AddCIPackage)
|
||||
set(oneValueArgs
|
||||
|
|
17
CMakeModules/Findmbedtls.cmake
Normal file
17
CMakeModules/Findmbedtls.cmake
Normal file
|
@ -0,0 +1,17 @@
|
|||
# SPDX-FileCopyrightText: 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_search_module(mbedtls QUIET IMPORTED_TARGET mbedtls)
|
||||
find_package_handle_standard_args(mbedtls
|
||||
REQUIRED_VARS mbedtls_LINK_LIBRARIES
|
||||
VERSION_VAR mbedtls_VERSION
|
||||
)
|
||||
|
||||
pkg_search_module(mbedcrypto QUIET IMPORTED_TARGET mbedcrypto)
|
||||
find_package_handle_standard_args(mbedcrypto
|
||||
REQUIRED_VARS mbedcrypto_LINK_LIBRARIES
|
||||
VERSION_VAR mbedcrypto_VERSION
|
||||
)
|
|
@ -10,8 +10,8 @@
|
|||
"boost": {
|
||||
"package": "Boost",
|
||||
"repo": "boostorg/boost",
|
||||
"tag": "boost-1.88.0",
|
||||
"artifact": "boost-1.88.0-cmake.7z",
|
||||
"tag": "boost-%VERSION%",
|
||||
"artifact": "%TAG%-cmake.7z",
|
||||
"hash": "e5b049e5b61964480ca816395f63f95621e66cb9bcf616a8b10e441e0e69f129e22443acb11e77bc1e8170f8e4171b9b7719891efc43699782bfcd4b3a365f01",
|
||||
"git_version": "1.88.0",
|
||||
"version": "1.57"
|
||||
|
|
|
@ -23,7 +23,7 @@ CPMUtil is a wrapper around CPM that aims to reduce boilerplate and add useful u
|
|||
|
||||
- `NAME` (required): The package name (must be the same as the `find_package` name if applicable)
|
||||
- `VERSION`: The minimum version of this package that can be used on the system
|
||||
- `GIT_VERSION`: The version found within git, only used for identification
|
||||
- `GIT_VERSION`: The "version" found within git
|
||||
- `URL`: The URL to fetch.
|
||||
- `REPO`: The GitHub repo to use (`owner/repo`).
|
||||
* Only GitHub is supported for now, though other platforms will see support at some point
|
||||
|
@ -71,8 +71,9 @@ Hashing strategies, descending order of precedence:
|
|||
- `KEY`: Custom cache key to use (stored as `.cache/cpm/${packagename_lower}/${key}`)
|
||||
* Default is based on, in descending order of precedence:
|
||||
- First 4 characters of the sha
|
||||
- `GIT_VERSION`, or `VERSION` if not specified
|
||||
- `GIT_VERSION`
|
||||
- Tag
|
||||
- `VERSION`
|
||||
- Otherwise, CPM defaults will be used. This is not recommended as it doesn't produce reproducible caches
|
||||
- `DOWNLOAD_ONLY`: Whether or not to configure the downloaded package via CMake
|
||||
* Useful to turn `OFF` if the project doesn't use CMake
|
||||
|
|
54
externals/CMakeLists.txt
vendored
54
externals/CMakeLists.txt
vendored
|
@ -70,7 +70,43 @@ if (mbedtls_ADDED)
|
|||
endif()
|
||||
|
||||
# libusb
|
||||
# TODO(crueter): remove entirely, replace with cpm
|
||||
if (ENABLE_LIBUSB AND NOT TARGET libusb::usb)
|
||||
set(module externals/libusb)
|
||||
|
||||
file(GLOB RESULT "${PROJECT_SOURCE_DIR}/${module}/")
|
||||
list(LENGTH RESULT RES_LEN)
|
||||
if(RES_LEN EQUAL 0)
|
||||
message(FATAL_ERROR "libusb not found. "
|
||||
"Please run: \ngit submodule update --init")
|
||||
endif()
|
||||
|
||||
if (EXISTS "${PROJECT_SOURCE_DIR}/${module}/.git")
|
||||
set(SUBMODULE_DIR "${PROJECT_SOURCE_DIR}/${module}")
|
||||
|
||||
execute_process(
|
||||
COMMAND git rev-parse --short=10 HEAD
|
||||
WORKING_DIRECTORY ${SUBMODULE_DIR}
|
||||
OUTPUT_VARIABLE SUBMODULE_SHA
|
||||
)
|
||||
|
||||
# would probably be better to do string parsing, but whatever
|
||||
execute_process(
|
||||
COMMAND git remote get-url origin
|
||||
WORKING_DIRECTORY ${SUBMODULE_DIR}
|
||||
OUTPUT_VARIABLE SUBMODULE_URL
|
||||
)
|
||||
|
||||
string(REGEX REPLACE "\n|\r" "" SUBMODULE_SHA ${SUBMODULE_SHA})
|
||||
string(REGEX REPLACE "\n|\r|\\.git" "" SUBMODULE_URL ${SUBMODULE_URL})
|
||||
|
||||
get_filename_component(SUBMODULE_NAME ${SUBMODULE_DIR} NAME)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_NAMES ${SUBMODULE_NAME})
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_SHAS ${SUBMODULE_SHA})
|
||||
set_property(GLOBAL APPEND PROPERTY CPM_PACKAGE_URLS ${SUBMODULE_URL})
|
||||
endif()
|
||||
|
||||
add_subdirectory(libusb)
|
||||
endif()
|
||||
|
||||
|
@ -110,21 +146,17 @@ if (YUZU_USE_BUNDLED_FFMPEG)
|
|||
set(FFmpeg_INCLUDE_DIR "${FFmpeg_INCLUDE_DIR}" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Vulkan-Headers
|
||||
|
||||
# TODO(crueter): Vk1.4 impl
|
||||
|
||||
# VulkanUtilityHeaders - pulls in headers and utility libs
|
||||
AddJsonPackage(
|
||||
NAME vulkan-headers
|
||||
BUNDLED_PACKAGE ${YUZU_USE_EXTERNAL_VULKAN_HEADERS}
|
||||
)
|
||||
|
||||
# Vulkan-Utility-Libraries
|
||||
AddJsonPackage(
|
||||
NAME vulkan-utility-libraries
|
||||
NAME vulkan-utility-headers
|
||||
BUNDLED_PACKAGE ${YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES}
|
||||
)
|
||||
|
||||
# small hack
|
||||
if (NOT VulkanUtilityLibraries_ADDED)
|
||||
find_package(VulkanHeaders 1.3.274 REQUIRED)
|
||||
endif()
|
||||
|
||||
# SPIRV Tools
|
||||
AddJsonPackage(
|
||||
NAME spirv-tools
|
||||
|
|
18
externals/cpmfile.json
vendored
18
externals/cpmfile.json
vendored
|
@ -3,6 +3,7 @@
|
|||
"repo": "Mbed-TLS/mbedtls",
|
||||
"sha": "8c88150ca1",
|
||||
"hash": "769ad1e94c570671071e1f2a5c0f1027e0bf6bcdd1a80ea8ac970f2c86bc45ce4e31aa88d6d8110fc1bed1de81c48bc624df1b38a26f8b340a44e109d784a966",
|
||||
"find_args": "MODULE",
|
||||
"patches": [
|
||||
"0001-cmake-version.patch"
|
||||
]
|
||||
|
@ -42,18 +43,13 @@
|
|||
"0002-missing-decl.patch"
|
||||
]
|
||||
},
|
||||
"vulkan-headers": {
|
||||
"package": "VulkanHeaders",
|
||||
"version": "1.3.274",
|
||||
"repo": "KhronosGroup/Vulkan-Headers",
|
||||
"sha": "89268a6d17",
|
||||
"hash": "3ab349f74298ba72cafb8561015690c0674d428a09fb91ccd3cd3daca83650d190d46d33fd97b0a8fd4223fe6df2bcabae89136fbbf7c0bfeb8776f9448304c8"
|
||||
},
|
||||
"vulkan-utility-libraries": {
|
||||
"vulkan-utility-headers": {
|
||||
"package": "VulkanUtilityLibraries",
|
||||
"repo": "KhronosGroup/Vulkan-Utility-Libraries",
|
||||
"sha": "df2e358152",
|
||||
"hash": "3e468c3d9ff93f6d418d71e5527abe0a12c8c7ab5b0b52278bbbee4d02bb87e99073906729b727e0147242b7e3fd5dedf68b803f1878cb4c0e4f730bc2238d79"
|
||||
"repo": "scripts/VulkanUtilityHeaders",
|
||||
"tag": "1.4.326",
|
||||
"artifact": "VulkanUtilityHeaders.tar.zst",
|
||||
"git_host": "git.crueter.xyz",
|
||||
"hash": "5924629755cb1605c4aa4eee20ef7957a9dd8d61e4df548be656d98054f2730c4109693c1bd35811f401f4705d2ccff9fc849be32b0d8480bc3f73541a5e0964"
|
||||
},
|
||||
"vulkan-memory-allocator": {
|
||||
"package": "VulkanMemoryAllocator",
|
||||
|
|
5
externals/nx_tzdb/cpmfile.json
vendored
5
externals/nx_tzdb/cpmfile.json
vendored
|
@ -1,7 +1,10 @@
|
|||
{
|
||||
"tzdb": {
|
||||
"package": "nx_tzdb",
|
||||
"url": "https://github.com/crueter/tzdb_to_nx/releases/download/250725/250725.zip",
|
||||
"repo": "misc/tzdb_to_nx",
|
||||
"git_host": "git.crueter.xyz",
|
||||
"artifact": "%VERSION%.zip",
|
||||
"tag": "%VERSION%",
|
||||
"hash": "8f60b4b29f285e39c0443f3d5572a73780f3dbfcfd5b35004451fadad77f3a215b2e2aa8d0fffe7e348e2a7b0660882b35228b6178dda8804a14ce44509fd2ca",
|
||||
"version": "250725"
|
||||
}
|
||||
|
|
|
@ -1199,7 +1199,7 @@ else()
|
|||
target_link_libraries(core PUBLIC Boost::headers)
|
||||
endif()
|
||||
|
||||
target_link_libraries(core PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API)
|
||||
target_link_libraries(core PRIVATE fmt::fmt nlohmann_json::nlohmann_json RenderDoc::API mbedtls)
|
||||
if (MINGW)
|
||||
target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
|
||||
endif()
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
@ -31,6 +34,10 @@
|
|||
#include "core/hle/service/filesystem/filesystem.h"
|
||||
#include "core/loader/loader.h"
|
||||
|
||||
#ifndef MBEDTLS_CMAC_C
|
||||
#error mbedtls was compiled without CMAC support. Check your USE flags (Gentoo) or contact your package maintainer.
|
||||
#endif
|
||||
|
||||
namespace Core::Crypto {
|
||||
namespace {
|
||||
|
||||
|
|
|
@ -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,21 +150,9 @@ 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)
|
||||
find_package(mcl 0.1.12 REQUIRED)
|
||||
|
||||
if ("arm64" IN_LIST ARCHITECTURE OR DYNARMIC_TESTS)
|
||||
find_package(oaknut 2.0.1 CONFIG)
|
||||
|
@ -169,6 +160,8 @@ 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)
|
||||
|
|
48
src/dynarmic/externals/CMakeLists.txt
vendored
48
src/dynarmic/externals/CMakeLists.txt
vendored
|
@ -1,3 +1,6 @@
|
|||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Explicitly include CPMUtil here since we have a separate cpmfile for dynarmic
|
||||
set(CPMUTIL_JSON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json)
|
||||
include(CPMUtil)
|
||||
|
@ -20,62 +23,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"
|
||||
|
|
|
@ -335,7 +335,7 @@ target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE})
|
|||
target_link_libraries(video_core PRIVATE sirit)
|
||||
|
||||
# Header-only stuff needed by all dependent targets
|
||||
target_link_libraries(video_core PUBLIC Vulkan::Headers Vulkan::UtilityHeaders GPUOpen::VulkanMemoryAllocator)
|
||||
target_link_libraries(video_core PUBLIC Vulkan::UtilityHeaders GPUOpen::VulkanMemoryAllocator)
|
||||
|
||||
if (ENABLE_NSIGHT_AFTERMATH)
|
||||
if (NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK})
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
# SPDX-FileCopyrightText: 2025 crueter
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
LIBS=$(find . externals externals/nx_tzdb src/yuzu/externals externals/ffmpeg src/dynarmic/externals -maxdepth 1 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ")
|
||||
LIBS=$(find . externals src/yuzu/externals src/dynarmic -maxdepth 2 -name cpmfile.json -exec jq -j 'keys_unsorted | join(" ")' {} \; -printf " ")
|
||||
|
||||
tools/cpm-fetch.sh $LIBS
|
|
@ -84,7 +84,7 @@ ci_package() {
|
|||
|
||||
for platform in windows-amd64 windows-arm64 android solaris freebsd linux linux-aarch64; do
|
||||
FILENAME="${NAME}-${platform}-${VERSION}.${EXT}"
|
||||
DOWNLOAD="https://github.com/${REPO}/releases/download/v${VERSION}/${FILENAME}"
|
||||
DOWNLOAD="https://$GIT_URL/${REPO}/releases/download/v${VERSION}/${FILENAME}"
|
||||
PACKAGE_NAME="$PACKAGE"
|
||||
KEY=$platform
|
||||
|
||||
|
@ -122,14 +122,32 @@ do
|
|||
URL=$(jq -r ".url" <<< "$JSON")
|
||||
REPO=$(jq -r ".repo" <<< "$JSON")
|
||||
SHA=$(jq -r ".sha" <<< "$JSON")
|
||||
GIT_URL=$(jq -r ".git_url" <<< "$JSON")
|
||||
|
||||
[ "$GIT_URL" == null ] && GIT_URL=github.com
|
||||
|
||||
VERSION=$(jq -r ".version" <<< "$JSON")
|
||||
GIT_VERSION=$(jq -r ".git_version" <<< "$JSON")
|
||||
|
||||
if [ "$GIT_VERSION" != null ]; then
|
||||
VERSION_REPLACE="$GIT_VERSION"
|
||||
else
|
||||
VERSION_REPLACE="$VERSION"
|
||||
fi
|
||||
|
||||
TAG=$(jq -r ".tag" <<< "$JSON")
|
||||
|
||||
TAG=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $TAG)
|
||||
|
||||
ARTIFACT=$(jq -r ".artifact" <<< "$JSON")
|
||||
ARTIFACT=$(sed "s/%VERSION%/$VERSION_REPLACE/" <<< $ARTIFACT)
|
||||
ARTIFACT=$(sed "s/%TAG%/$TAG/" <<< $ARTIFACT)
|
||||
|
||||
if [ "$URL" != "null" ]; then
|
||||
DOWNLOAD="$URL"
|
||||
elif [ "$REPO" != "null" ]; then
|
||||
GIT_URL="https://github.com/$REPO"
|
||||
GIT_URL="https://$GIT_URL/$REPO"
|
||||
|
||||
TAG=$(jq -r ".tag" <<< "$JSON")
|
||||
ARTIFACT=$(jq -r ".artifact" <<< "$JSON")
|
||||
BRANCH=$(jq -r ".branch" <<< "$JSON")
|
||||
|
||||
if [ "$TAG" != "null" ]; then
|
||||
|
@ -155,24 +173,21 @@ do
|
|||
# key parsing
|
||||
KEY=$(jq -r ".key" <<< "$JSON")
|
||||
|
||||
if [ "$KEY" == null ]; then
|
||||
VERSION=$(jq -r ".version" <<< "$JSON")
|
||||
GIT_VERSION=$(jq -r ".git_version" <<< "$JSON")
|
||||
|
||||
if [ "$KEY" == null ]; then
|
||||
if [ "$SHA" != null ]; then
|
||||
KEY=$(cut -c1-4 - <<< "$SHA")
|
||||
elif [ "$GIT_VERSION" != null ]; then
|
||||
KEY="$GIT_VERSION"
|
||||
elif [ "$TAG" != null ]; then
|
||||
KEY="$TAG"
|
||||
elif [ "$VERSION" != null ]; then
|
||||
KEY="$VERSION"
|
||||
else
|
||||
echo "No valid key could be determined for $package. Must define one of: key, sha, version, git_version"
|
||||
echo "No valid key could be determined for $package. Must define one of: key, sha, tag, version, git_version"
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $KEY
|
||||
|
||||
echo "Downloading regular package $package, with key $KEY, from $DOWNLOAD"
|
||||
|
||||
# hash parsing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue