[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:
crueter
2025-09-08 19:21:38 +02:00
committed by crueter
parent ecc99ce9ab
commit 428f136a75
39 changed files with 921 additions and 904 deletions

View File

@@ -1,6 +1,7 @@
#!/bin/sh -e
HEADER="$(cat "$PWD/.ci/license/header.txt")"
HEADER_HASH="$(cat "$PWD/.ci/license/header-hash.txt")"
echo "Getting branch changes"
@@ -13,41 +14,86 @@ FILES=`git diff-tree --no-commit-id --name-only ${RANGE} -r`
echo "Done"
check_header() {
CONTENT="`head -n3 < $1`"
case "$CONTENT" in
"$HEADER"*) ;;
*) BAD_FILES="$BAD_FILES $1" ;;
esac
}
check_cmake_header() {
CONTENT="`head -n3 < $1`"
case "$CONTENT" in
"$HEADER_HASH"*) ;;
*)
BAD_CMAKE="$BAD_CMAKE $1" ;;
esac
}
for file in $FILES; do
[ -f "$file" ] || continue
if [ `basename -- "$file"` = "CMakeLists.txt" ]; then
check_cmake_header "$file"
continue
fi
EXTENSION="${file##*.}"
case "$EXTENSION" in
kts|kt|cpp|h)
CONTENT="`cat $file`"
case "$CONTENT" in
"$HEADER"*) ;;
*) BAD_FILES="$BAD_FILES $file" ;;
esac
check_header "$file"
;;
cmake)
check_cmake_header "$file"
;;
esac
done
if [ "$BAD_FILES" = "" ]; then
if [ "$BAD_FILES" = "" ] && [ "$BAD_CMAKE" = "" ]; then
echo
echo "All good."
exit
fi
echo "The following files have incorrect license headers:"
echo
if [ "$BAD_FILES" != "" ]; then
echo "The following source files have incorrect license headers:"
echo
for file in $BAD_FILES; do echo $file; done
for file in $BAD_FILES; do echo $file; done
cat << EOF
cat << EOF
The following license header should be added to the start of all offending files:
The following license header should be added to the start of all offending SOURCE files:
=== BEGIN ===
$HEADER
=== END ===
EOF
fi
if [ "$BAD_CMAKE" != "" ]; then
echo "The following CMake files have incorrect license headers:"
echo
for file in $BAD_CMAKE; do echo $file; done
cat << EOF
The following license header should be added to the start of all offending CMake files:
=== BEGIN ===
$HEADER_HASH
=== END ===
EOF
fi
cat << EOF
If some of the code in this PR is not being contributed by the original author,
the files which have been exclusively changed by that code can be ignored.
If this happens, this PR requirement can be bypassed once all other files are addressed.
@@ -70,6 +116,17 @@ if [ "$FIX" = "true" ]; then
git add $file
done
for file in $BAD_CMAKE; do
cat $file > $file.bak
cat .ci/license/header-hash.txt > $file
echo >> $file
cat $file.bak >> $file
rm $file.bak
git add $file
done
echo "License headers fixed."
if [ "$COMMIT" = "true" ]; then

View File

@@ -0,0 +1,2 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later

6
.gitmodules vendored
View File

@@ -1,6 +0,0 @@
# SPDX-FileCopyrightText: 2014 Citra Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
[submodule "libusb"]
path = externals/libusb/libusb
url = https://github.com/libusb/libusb.git

View File

@@ -48,12 +48,10 @@ endif()
# On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion
CMAKE_DEPENDENT_OPTION(ENABLE_SDL2 "Enable the SDL2 frontend" ON "NOT ANDROID" OFF)
set(EXT_DEFAULT ON)
set(EXT_DEFAULT OFF)
# See https://github.com/llvm/llvm-project/issues/123946
# OpenBSD va_list doesn't play nice with precompiled headers
if (PLATFORM_FREEBSD OR PLATFORM_OPENBSD)
set(EXT_DEFAULT OFF)
if (MSVC OR ANDROID)
set(EXT_DEFAULT ON)
endif()
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ${EXT_DEFAULT} "ENABLE_SDL2;NOT MSVC" OFF)
@@ -69,14 +67,13 @@ option(ENABLE_QT_UPDATE_CHECKER "Enable update checker for the Qt frontend" OFF)
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF)
option(YUZU_USE_CPM "Use CPM to fetch Eden dependencies if needed" ON)
option(YUZU_USE_CPM "Use CPM to fetch system dependencies (fmt, boost, etc) if needed. Externals will still be fetched." ${EXT_DEFAULT})
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)
@@ -95,10 +92,12 @@ option(YUZU_TESTS "Compile tests" "${BUILD_TESTING}")
option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ${EXT_DEFAULT})
# TODO(crueter): CI this?
option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON)
option(FORCE_DOWNLOAD_WIN_BUNDLES "Forcefully download bundled Windows dependencies (useful for CI)" OFF)
# TODO(crueter): Cleanup, each dep that has a bundled option should allow to choose between bundled, external, system
if (YUZU_USE_CPM AND ENABLE_SDL2)
option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 build" "${MSVC}")
endif()
@@ -107,12 +106,10 @@ CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Enable dedicated room functionality" ON "NOT A
CMAKE_DEPENDENT_OPTION(YUZU_ROOM_STANDALONE "Enable standalone room executable" ON "YUZU_ROOM" OFF)
CMAKE_DEPENDENT_OPTION(YUZU_CMD "Compile the eden-cli executable" ON "NOT ANDROID" OFF)
CMAKE_DEPENDENT_OPTION(YUZU_CMD "Compile the eden-cli executable" ON "ENABLE_SDL2;NOT ANDROID" OFF)
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)
@@ -277,7 +227,7 @@ function(detect_architecture symbol arch)
if (ARCHITECTURE_${arch})
set(ARCHITECTURE "${arch}" PARENT_SCOPE)
set(ARCHITECTURE_${arch} 1 PARENT_SCOPE)
add_definitions(-DARCHITECTURE_${arch}=1)
add_compile_definitions(ARCHITECTURE_${arch}=1)
endif()
endif()
endfunction()
@@ -299,7 +249,7 @@ endif()
if (NOT DEFINED ARCHITECTURE)
set(ARCHITECTURE "GENERIC")
set(ARCHITECTURE_GENERIC 1)
add_definitions(-DARCHITECTURE_GENERIC=1)
add_compile_definitions(ARCHITECTURE_GENERIC=1)
endif()
message(STATUS "Target architecture: ${ARCHITECTURE}")
@@ -311,16 +261,16 @@ if (MSVC AND ARCHITECTURE_x86)
endif()
if (UNIX)
add_definitions(-DYUZU_UNIX=1)
add_compile_definitions(YUZU_UNIX=1)
endif()
if (ARCHITECTURE_arm64 AND (ANDROID OR PLATFORM_LINUX))
set(HAS_NCE 1)
add_definitions(-DHAS_NCE=1)
add_compile_definitions(HAS_NCE=1)
endif()
if (YUZU_ROOM)
add_definitions(-DYUZU_ROOM)
add_compile_definitions(YUZU_ROOM)
endif()
# Build/optimization presets
@@ -489,14 +439,6 @@ if(NOT TARGET Boost::headers)
AddJsonPackage(boost_headers)
endif()
if (ENABLE_LIBUSB)
if (PLATFORM_FREEBSD)
find_package(libusb MODULE)
else()
find_package(libusb 1.0.24 MODULE)
endif()
endif()
# DiscordRPC
if (USE_DISCORD_PRESENCE)
AddJsonPackage(discord-rpc)
@@ -601,8 +543,8 @@ endfunction()
add_subdirectory(externals)
# pass targets from externals
find_package(VulkanHeaders)
find_package(VulkanUtilityLibraries)
find_package(libusb)
find_package(VulkanMemoryAllocator)
find_package(SPIRV-Tools)
@@ -736,7 +678,7 @@ if (APPLE)
list(APPEND PLATFORM_LIBRARIES ${ICONV_LIBRARY})
elseif (WIN32)
# Target Windows 10
add_definitions(-D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00)
add_compile_definitions(_WIN32_WINNT=0x0A00 WINVER=0x0A00)
set(PLATFORM_LIBRARIES winmm ws2_32 iphlpapi)
if (MINGW)
# PSAPI is the Process Status API

View File

@@ -11,10 +11,11 @@
# Future crueter: Wow this was a lie and a half, at this point I might as well make my own CPN
# haha just kidding... unless?
# TODO(crueter): Remember to get more than 6 hours of sleep whenever making giant cmake changes
if (MSVC OR ANDROID)
set(BUNDLED_DEFAULT OFF)
else()
set(BUNDLED_DEFAULT ON)
else()
set(BUNDLED_DEFAULT OFF)
endif()
option(CPMUTIL_FORCE_BUNDLED
@@ -26,8 +27,7 @@ option(CPMUTIL_FORCE_SYSTEM
cmake_minimum_required(VERSION 3.22)
include(CPM)
# TODO(crueter): Better solution for separate cpmfiles e.g. per-directory
set(CPMUTIL_JSON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json" CACHE STRING "Location of cpmfile.json")
set(CPMUTIL_JSON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json")
if (EXISTS ${CPMUTIL_JSON_FILE})
file(READ ${CPMUTIL_JSON_FILE} CPMFILE_CONTENT)
@@ -148,11 +148,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")
@@ -201,6 +222,8 @@ function(AddJsonPackage)
SOURCE_SUBDIR "${source_subdir}"
GIT_VERSION ${git_version}
GIT_HOST ${git_host}
ARTIFACT ${artifact}
TAG ${tag}
)
@@ -240,6 +263,7 @@ function(AddPackage)
NAME
VERSION
GIT_VERSION
GIT_HOST
REPO
TAG
@@ -272,11 +296,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})
@@ -285,7 +315,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})
@@ -316,25 +346,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")
@@ -445,12 +473,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")
@@ -495,6 +526,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

View 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
)

View File

@@ -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"

View File

@@ -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
@@ -232,12 +233,9 @@ In order: OpenSSL CI, Boost (tag + artifact), discord-rpc (sha + options + patch
To include CPMUtil:
```cmake
set(CPMUTIL_JSON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json)
include(CPMUtil)
```
You may omit the first line if you are not utilizing cpmfile.
## Prefetching
- To prefetch a CPM dependency (requires cpmfile):
@@ -245,8 +243,8 @@ You may omit the first line if you are not utilizing cpmfile.
- To prefetch all CPM dependencies:
* `tools/cpm-fetch-all.sh`
Currently, `cpm-fetch.sh` defines the following directories for cpmfiles:
Currently, `cpm-fetch.sh` defines the following directories for cpmfiles (max depth of 2, so subdirs are caught as well):
`externals src/yuzu/externals externals/ffmpeg src/dynarmic/externals externals/nx_tzdb`
`externals src/yuzu src/dynarmic .`
Whenever you add a new cpmfile, update the script accordingly

12
docs/build/FreeBSD.md vendored
View File

@@ -1,13 +1,7 @@
## One word of caution before proceeding.
This is not the usual or preferred way to build programs on FreeBSD.
As of writing there is no official fresh port available for Eden, but it is in the works.
After it is available you can find a link to the eden-emu fresh port here and on Escary's github repo.
See this build as an AppImage alternative for FreeBSD.
Eden is not currently available as a port on FreeBSD, though it is in the works. For now, the recommended method of usage is to compile it yourself. Check back often, as the build process frequently changes.
## Dependencies.
Before we start we need some dependencies.
These dependencies are generally needed to build Eden on FreeBSD.
Eden needs the following dependencies:
```
devel/cmake
@@ -22,6 +16,8 @@ devel/autoconf
devel/pkgconf
devel/qt6-base
net/enet
multimedia/ffnvcodec-headers
multimedia/ffmpeg

65
docs/build/macOS.md vendored
View File

@@ -1,43 +1,36 @@
Please note this article is intended for development, and eden on macOS is not currently ready for regular use.
Please note this article is intended for development, and Eden on macOS is not currently ready for regular use.
This article was written for developers. eden support for macOS is not ready for casual use.
## Method I: ninja
---
If you are compiling on Intel Mac or are using a Rosetta Homebrew installation, you must replace all references of `/opt/homebrew` to `/usr/local`.
This article was written for developers. Eden support for macOS is not ready for casual use.
## Dependencies
Install dependencies from Homebrew:
```sh
brew install autoconf automake boost ccache ffmpeg fmt glslang hidapi libtool libusb lz4 ninja nlohmann-json openssl pkg-config qt@6 sdl2 speexdsp zlib zlib zstd cmake Catch2 molten-vk vulkan-loader
brew install autoconf automake boost ffmpeg fmt glslang hidapi libtool libusb lz4 ninja nlohmann-json openssl pkg-config qt@6 sdl2 speexdsp zlib zstd cmake Catch2 molten-vk vulkan-loader spirv-tools
```
Clone the repo
If you are compiling on Intel Mac, or are using a Rosetta Homebrew installation, you must replace all references of `/opt/homebrew` with `/usr/local`.
Now, clone the repo:
```sh
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
cd eden
```
## Method I: ninja
---
Build for release
```sh
mkdir build && cd build
export Qt6_DIR="/opt/homebrew/opt/qt@6/lib/cmake"
export LIBVULKAN_PATH=/opt/homebrew/lib/libvulkan.dylib
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=ON -DENABLE_LIBUSB=OFF -DCLANG_FORMAT=ON -DSDL2_DISABLE_INSTALL=ON -DSDL_ALTIVEC=ON
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=ON -DENABLE_LIBUSB=OFF -DCLANG_FORMAT=ON -DSDL2_DISABLE_INSTALL=ON -DSDL_ALTIVEC=ON
ninja
```
You may also want to include support for Discord Rich Presence by adding `-DUSE_DISCORD_PRESENCE=ON` after `cmake ..`
Build with debug symbols (vcpkg is not currently used due to broken boost-context library):
You may also want to include support for Discord Rich Presence by adding `-DUSE_DISCORD_PRESENCE=ON`
```sh
mkdir build && cd build
export Qt6_DIR="/opt/homebrew/opt/qt@6/lib/cmake"
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
ninja
```
@@ -49,40 +42,20 @@ bin/eden.app/Contents/MacOS/eden
## Method II: Xcode
---
If you are compiling on Intel Mac or are using a Rosetta Homebrew installation, you must replace all references of `/opt/homebrew` to `/usr/local`.
Install dependencies from Homebrew:
```sh
brew install autoconf automake boost ccache ffmpeg fmt glslang hidapi libtool libusb lz4 ninja nlohmann-json openssl pkg-config qt@6 sdl2 speexdsp zlib zlib zstd cmake Catch2 molten-vk vulkan-loader
```
Clone the repo
```sh
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
cd eden
```
Build for release
```sh
mkdir build && cd build
export Qt6_DIR="/opt/homebrew/opt/qt@6/lib/cmake"
export LIBVULKAN_PATH=/opt/homebrew/lib/libvulkan.dylib
cmake .. -GXcode -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=ON -DENABLE_LIBUSB=OFF -DCLANG_FORMAT=ON -DSDL2_DISABLE_INSTALL=ON -DSDL_ALTIVEC=ON
xcodebuild build -project eden.xcodeproj -scheme "eden" -configuration "RelWithDebInfo"
# Only if having errors about Xcode 15.0
sudo /usr/bin/xcode-select --switch /Users/admin/Downloads/Xcode.ap
cmake -B build -GXcode -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=ON -DENABLE_LIBUSB=OFF -DCLANG_FORMAT=ON -DSDL2_DISABLE_INSTALL=ON -DSDL_ALTIVEC=ON
xcodebuild build -project yuzu.xcodeproj -scheme "yuzu" -configuration "RelWithDebInfo"
```
You may also want to include support for Discord Rich Presence by adding `-DUSE_DISCORD_PRESENCE=ON` after `cmake ..`
Build with debug symbols (vcpkg is not currently used due to broken boost-context library):
Build with debug symbols:
```sh
mkdir build && cd build
export Qt6_DIR="/opt/homebrew/opt/qt@6/lib/cmake"
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
ninja
```

View File

@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -7,8 +10,6 @@
# TODO(crueter): A lot of this should be moved to the root.
# otherwise we have to do weird shenanigans with library linking and stuff
# Explicitly include CPMUtil here since we have a separate cpmfile for externals
set(CPMUTIL_JSON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json)
include(CPMUtil)
# Explicitly declare this option here to propagate to the oaknut CPM call
@@ -67,7 +68,7 @@ if (mbedtls_ADDED)
endif()
# libusb
if (ENABLE_LIBUSB AND NOT TARGET libusb::usb)
if (ENABLE_LIBUSB)
add_subdirectory(libusb)
endif()
@@ -107,21 +108,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
@@ -239,7 +236,7 @@ if (YUZU_CRASH_DUMPS AND NOT TARGET libbreakpad_client)
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES ${breakpad_SOURCE_DIR}/src/client/mac/*.cc ${breakpad_SOURCE_DIR}/src/common/mac/*.cc)
list(APPEND LIBBREAKPAD_CLIENT_SOURCES ${breakpad_SOURCE_DIR}/src/common/mac/MachIPC.mm)
else()
target_compile_definitions(libbreakpad_client PUBLIC -DHAVE_A_OUT_H)
target_compile_definitions(libbreakpad_client PUBLIC HAVE_A_OUT_H)
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES ${breakpad_SOURCE_DIR}/src/client/linux/*.cc ${breakpad_SOURCE_DIR}/src/common/linux/*.cc)
endif()
list(APPEND LIBBREAKPAD_CLIENT_SOURCES ${LIBBREAKPAD_COMMON_SOURCES})

View File

@@ -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",

View File

@@ -1,8 +1,6 @@
# SPDX-FileCopyrightText: 2021 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
# Explicitly include CPMUtil here since we have a separate cpmfile for ffmpeg
set(CPMUTIL_JSON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json)
include(CPMUtil)
if (NOT WIN32 AND NOT ANDROID)

View File

@@ -1,7 +1,15 @@
# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
if (MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR APPLE)
include(CPMUtil)
AddJsonPackage(libusb)
if (NOT libusb_ADDED)
return()
endif()
if (MINGW OR PLATFORM_LINUX OR APPLE)
set(LIBUSB_FOUND ON CACHE BOOL "libusb is present" FORCE)
set(LIBUSB_VERSION "1.0.24" CACHE STRING "libusb version string" FORCE)
@@ -19,8 +27,8 @@ if (MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR APPLE)
message(FATAL_ERROR "Required program `libtoolize` not found.")
endif()
set(LIBUSB_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/libusb")
set(LIBUSB_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libusb")
set(LIBUSB_PREFIX "${libusb_BINARY_DIR}")
set(LIBUSB_SRC_DIR "${libusb_SOURCE_DIR}")
# Workarounds for MSYS/MinGW
if (MSYS)
@@ -118,27 +126,27 @@ else() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif()
add_library(usb
libusb/libusb/core.c
libusb/libusb/core.c
libusb/libusb/descriptor.c
libusb/libusb/hotplug.c
libusb/libusb/io.c
libusb/libusb/strerror.c
libusb/libusb/sync.c
${libusb_SOURCE_DIR}/libusb/core.c
${libusb_SOURCE_DIR}/libusb/core.c
${libusb_SOURCE_DIR}/libusb/descriptor.c
${libusb_SOURCE_DIR}/libusb/hotplug.c
${libusb_SOURCE_DIR}/libusb/io.c
${libusb_SOURCE_DIR}/libusb/strerror.c
${libusb_SOURCE_DIR}/libusb/sync.c
)
set_target_properties(usb PROPERTIES VERSION 1.0.24)
if(WIN32)
target_include_directories(usb
BEFORE
PUBLIC
libusb/libusb
${libusb_SOURCE_DIR}/libusb
PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}"
)
if (NOT MINGW)
target_include_directories(usb BEFORE PRIVATE libusb/msvc)
target_include_directories(usb BEFORE PRIVATE ${libusb_SOURCE_DIR}/msvc)
endif()
else()
@@ -148,7 +156,7 @@ else() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
BEFORE
PUBLIC
libusb/libusb
${libusb_SOURCE_DIR}/libusb
PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}"
@@ -157,15 +165,15 @@ else() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(WIN32 OR CYGWIN)
target_sources(usb PRIVATE
libusb/libusb/os/threads_windows.c
libusb/libusb/os/windows_winusb.c
libusb/libusb/os/windows_usbdk.c
libusb/libusb/os/windows_common.c
${libusb_SOURCE_DIR}/libusb/os/threads_windows.c
${libusb_SOURCE_DIR}/libusb/os/windows_winusb.c
${libusb_SOURCE_DIR}/libusb/os/windows_usbdk.c
${libusb_SOURCE_DIR}/libusb/os/windows_common.c
)
set(OS_WINDOWS TRUE)
elseif(APPLE)
target_sources(usb PRIVATE
libusb/libusb/os/darwin_usb.c
${libusb_SOURCE_DIR}/libusb/os/darwin_usb.c
)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(IOKIT_LIBRARY IOKit)
@@ -178,20 +186,20 @@ else() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(OS_DARWIN TRUE)
elseif(ANDROID)
target_sources(usb PRIVATE
libusb/libusb/os/linux_usbfs.c
libusb/libusb/os/linux_netlink.c
${libusb_SOURCE_DIR}/libusb/os/linux_usbfs.c
${libusb_SOURCE_DIR}/libusb/os/linux_netlink.c
)
find_library(LOG_LIBRARY log)
target_link_libraries(usb PRIVATE ${LOG_LIBRARY})
set(OS_LINUX TRUE)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_sources(usb PRIVATE
libusb/libusb/os/linux_usbfs.c
${libusb_SOURCE_DIR}/libusb/os/linux_usbfs.c
)
find_package(Libudev)
if(LIBUDEV_FOUND)
target_sources(usb PRIVATE
libusb/libusb/os/linux_udev.c
${libusb_SOURCE_DIR}/libusb/os/linux_udev.c
)
target_link_libraries(usb PRIVATE "${LIBUDEV_LIBRARIES}")
target_include_directories(usb PRIVATE "${LIBUDEV_INCLUDE_DIR}")
@@ -199,26 +207,26 @@ else() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(USE_UDEV TRUE)
else()
target_sources(usb PRIVATE
libusb/libusb/os/linux_netlink.c
${libusb_SOURCE_DIR}/libusb/os/linux_netlink.c
)
endif()
set(OS_LINUX TRUE)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
target_sources(usb PRIVATE
libusb/libusb/os/netbsd_usb.c
${libusb_SOURCE_DIR}/libusb/os/netbsd_usb.c
)
set(OS_NETBSD TRUE)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
target_sources(usb PRIVATE
libusb/libusb/os/openbsd_usb.c
${libusb_SOURCE_DIR}/libusb/os/openbsd_usb.c
)
set(OS_OPENBSD TRUE)
endif()
if(UNIX)
target_sources(usb PRIVATE
libusb/libusb/os/events_posix.c
libusb/libusb/os/threads_posix.c
${libusb_SOURCE_DIR}/libusb/os/events_posix.c
${libusb_SOURCE_DIR}/libusb/os/threads_posix.c
)
find_package(Threads REQUIRED)
if(THREADS_HAVE_PTHREAD_ARG)
@@ -230,8 +238,8 @@ else() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(THREADS_POSIX TRUE)
elseif(WIN32)
target_sources(usb PRIVATE
libusb/libusb/os/events_windows.c
libusb/libusb/os/threads_windows.c
${libusb_SOURCE_DIR}/libusb/os/events_windows.c
${libusb_SOURCE_DIR}/libusb/os/threads_windows.c
)
endif()

8
externals/libusb/cpmfile.json vendored Normal file
View File

@@ -0,0 +1,8 @@
{
"libusb": {
"repo": "libusb/libusb",
"sha": "c060e9ce30",
"hash": "44647357ba1179020cfa6674d809fc35cf6f89bff1c57252fe3a610110f5013ad678fc6eb5918e751d4384c30e2fe678868dbffc5f85736157e546cb9d10accc",
"find_args": "MODULE"
}
}

Submodule externals/libusb/libusb deleted from c060e9ce30

View File

@@ -4,8 +4,6 @@
# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
# Explicitly include CPMUtil here since we have a separate cpmfile for nx_tzdb
set(CPMUTIL_JSON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json)
include(CPMUtil)
set(NX_TZDB_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")

View File

@@ -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"
}

View File

@@ -22,16 +22,16 @@ if (MSVC)
set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE)
# Silence "deprecation" warnings
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE _SCL_SECURE_NO_WARNINGS)
# Avoid windows.h junk
add_definitions(-DNOMINMAX)
add_compile_definitions(NOMINMAX)
# Avoid windows.h from including some usually unused libs like winsocks.h, since this might cause some redefinition errors.
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_compile_definitions(WIN32_LEAN_AND_MEAN)
# Ensure that projects are built with Unicode support.
add_definitions(-DUNICODE -D_UNICODE)
add_compile_definitions(UNICODE _UNICODE)
# /W4 - Level 4 warnings
# /MP - Multi-threaded compilation
@@ -169,15 +169,15 @@ else()
# glibc, which may default to 32 bits. glibc allows this to be configured
# by setting _FILE_OFFSET_BITS.
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR MINGW)
add_definitions(-D_FILE_OFFSET_BITS=64)
add_compile_definitions(_FILE_OFFSET_BITS=64)
endif()
if (MINGW)
add_definitions(-DMINGW_HAS_SECURE_API)
add_compile_definitions(MINGW_HAS_SECURE_API)
add_compile_options("-msse4.1")
if (MINGW_STATIC_BUILD)
add_definitions(-DQT_STATICPLUGIN)
add_compile_definitions(QT_STATICPLUGIN)
add_compile_options("-static")
endif()
endif()

View File

@@ -17,7 +17,7 @@ add_library(yuzu-android SHARED
set_property(TARGET yuzu-android PROPERTY IMPORTED_LOCATION ${FFmpeg_LIBRARY_DIR})
target_link_libraries(yuzu-android PRIVATE audio_core common core input_common frontend_common Vulkan::Headers GPUOpen::VulkanMemoryAllocator)
target_link_libraries(yuzu-android PRIVATE audio_core common core input_common frontend_common video_core)
target_link_libraries(yuzu-android PRIVATE android camera2ndk EGL glad jnigraphics log)
if (ARCHITECTURE_arm64)
target_link_libraries(yuzu-android PRIVATE adrenotools)

View File

@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
@@ -229,9 +232,10 @@ endif()
target_include_directories(audio_core PRIVATE ${OPUS_INCLUDE_DIRS})
target_link_libraries(audio_core PUBLIC common core opus)
if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
target_link_libraries(audio_core PRIVATE dynarmic::dynarmic)
endif()
# what?
# if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
# target_link_libraries(audio_core PRIVATE dynarmic::dynarmic)
# endif()
if (ENABLE_CUBEB)
target_sources(audio_core PRIVATE
@@ -240,7 +244,7 @@ if (ENABLE_CUBEB)
)
target_link_libraries(audio_core PRIVATE cubeb)
target_compile_definitions(audio_core PRIVATE -DHAVE_CUBEB=1)
target_compile_definitions(audio_core PRIVATE HAVE_CUBEB=1)
endif()
if (ENABLE_SDL2)

View File

@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
@@ -1155,7 +1158,7 @@ add_library(core STATIC
if (ENABLE_WIFI_SCAN)
# find_package(libiw REQUIRED)
target_compile_definitions(core PRIVATE -DENABLE_WIFI_SCAN)
target_compile_definitions(core PRIVATE ENABLE_WIFI_SCAN)
target_link_libraries(core PRIVATE iw)
endif()
@@ -1196,13 +1199,13 @@ 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()
if (ENABLE_WEB_SERVICE)
target_compile_definitions(core PUBLIC -DENABLE_WEB_SERVICE)
target_compile_definitions(core PUBLIC ENABLE_WEB_SERVICE)
target_link_libraries(core PUBLIC web_service)
endif()

View File

@@ -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 {

View File

@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2017 Citra Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
@@ -13,7 +16,7 @@ add_library(yuzu-room STATIC EXCLUDE_FROM_ALL
target_link_libraries(yuzu-room PRIVATE common network)
if (ENABLE_WEB_SERVICE)
target_compile_definitions(yuzu-room PRIVATE -DENABLE_WEB_SERVICE)
target_compile_definitions(yuzu-room PRIVATE ENABLE_WEB_SERVICE)
target_link_libraries(yuzu-room PRIVATE web_service)
endif()

View File

@@ -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)

View File

@@ -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

View File

@@ -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",

View File

@@ -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"

View File

@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -21,7 +24,7 @@ create_target_directory_groups(network)
target_link_libraries(network PRIVATE common enet Boost::headers)
if (ENABLE_WEB_SERVICE)
target_compile_definitions(network PRIVATE -DENABLE_WEB_SERVICE)
target_compile_definitions(network PRIVATE ENABLE_WEB_SERVICE)
target_link_libraries(network PRIVATE web_service)
endif()

View File

@@ -332,8 +332,10 @@ target_link_options(video_core PRIVATE ${FFmpeg_LDFLAGS})
add_dependencies(video_core host_shaders)
target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE})
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers Vulkan::UtilityHeaders)
target_link_libraries(video_core PUBLIC GPUOpen::VulkanMemoryAllocator)
target_link_libraries(video_core PRIVATE sirit)
# Header-only stuff needed by all dependent targets
target_link_libraries(video_core PUBLIC Vulkan::UtilityHeaders GPUOpen::VulkanMemoryAllocator)
if (ENABLE_NSIGHT_AFTERMATH)
if (NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK})

View File

@@ -401,7 +401,6 @@ target_link_libraries(yuzu PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(yuzu PRIVATE Boost::headers glad Qt6::Widgets)
target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
target_link_libraries(yuzu PRIVATE Vulkan::Headers)
if (NOT WIN32)
target_include_directories(yuzu PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
endif()
@@ -416,24 +415,24 @@ endif()
target_compile_definitions(yuzu PRIVATE
# Use QStringBuilder for string concatenation to reduce
# the overall number of temporary strings created.
-DQT_USE_QSTRINGBUILDER
QT_USE_QSTRINGBUILDER
# Disable implicit conversions from/to C strings
-DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_TO_ASCII
QT_NO_CAST_FROM_ASCII
QT_NO_CAST_TO_ASCII
# Disable implicit type narrowing in signal/slot connect() calls.
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
# Disable unsafe overloads of QProcess' start() function.
-DQT_NO_PROCESS_COMBINED_ARGUMENT_START
QT_NO_PROCESS_COMBINED_ARGUMENT_START
# Disable implicit QString->QUrl conversions to enforce use of proper resolving functions.
-DQT_NO_URL_CAST_FROM_STRING
QT_NO_URL_CAST_FROM_STRING
)
if (YUZU_ENABLE_COMPATIBILITY_REPORTING)
target_compile_definitions(yuzu PRIVATE -DYUZU_ENABLE_COMPATIBILITY_REPORTING)
target_compile_definitions(yuzu PRIVATE YUZU_ENABLE_COMPATIBILITY_REPORTING)
endif()
if (USE_DISCORD_PRESENCE)
@@ -441,22 +440,22 @@ if (USE_DISCORD_PRESENCE)
discord_impl.cpp
discord_impl.h
)
target_link_libraries(yuzu PRIVATE DiscordRPC::discord-rpc httplib::httplib Qt${QT_MAJOR_VERSION}::Network)
target_compile_definitions(yuzu PRIVATE -DUSE_DISCORD_PRESENCE)
target_link_libraries(yuzu PRIVATE DiscordRPC::discord-rpc httplib::httplib Qt6::Network)
target_compile_definitions(yuzu PRIVATE USE_DISCORD_PRESENCE)
endif()
if (ENABLE_WEB_SERVICE)
target_compile_definitions(yuzu PRIVATE -DENABLE_WEB_SERVICE)
target_compile_definitions(yuzu PRIVATE ENABLE_WEB_SERVICE)
endif()
if (YUZU_USE_QT_MULTIMEDIA)
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::Multimedia)
target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_MULTIMEDIA)
target_link_libraries(yuzu PRIVATE Qt6::Multimedia)
target_compile_definitions(yuzu PRIVATE YUZU_USE_QT_MULTIMEDIA)
endif ()
if (YUZU_USE_QT_WEB_ENGINE)
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::WebEngineCore Qt${QT_MAJOR_VERSION}::WebEngineWidgets)
target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_WEB_ENGINE)
target_link_libraries(yuzu PRIVATE Qt6::WebEngineCore Qt6::WebEngineWidgets)
target_compile_definitions(yuzu PRIVATE YUZU_USE_QT_WEB_ENGINE)
endif ()
if(UNIX AND NOT APPLE)
@@ -468,6 +467,7 @@ if (WIN32 AND NOT YUZU_USE_BUNDLED_QT AND QT_VERSION VERSION_GREATER_EQUAL 6)
add_custom_command(TARGET yuzu POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} "${YUZU_EXE_DIR}/eden.exe" --dir "${YUZU_EXE_DIR}" --libdir "${YUZU_EXE_DIR}" --plugindir "${YUZU_EXE_DIR}/plugins" --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --no-translations --verbose 0)
endif()
# TODO(crueter): this can be done with system qt in a better way
if (YUZU_USE_BUNDLED_QT)
include(CopyYuzuQt6Deps)
copy_yuzu_Qt6_deps(yuzu)

View File

@@ -1,8 +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 Qt externals
set(CPMUTIL_JSON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json)
include(CPMUtil)
# Disable tests/tools in all externals supporting the standard option name

View File

@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
@@ -28,7 +31,7 @@ add_executable(yuzu-cmd
yuzu.rc
)
target_link_libraries(yuzu-cmd PRIVATE common core input_common frontend_common)
target_link_libraries(yuzu-cmd PRIVATE common core input_common frontend_common video_core)
target_link_libraries(yuzu-cmd PRIVATE glad)
if (MSVC)
target_link_libraries(yuzu-cmd PRIVATE getopt)
@@ -38,8 +41,7 @@ target_link_libraries(yuzu-cmd PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
create_resource("../../dist/yuzu.bmp" "yuzu_cmd/yuzu_icon.h" "yuzu_icon")
target_include_directories(yuzu-cmd PRIVATE ${RESOURCES_DIR})
target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers)
target_link_libraries(yuzu-cmd PRIVATE GPUOpen::VulkanMemoryAllocator)
target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2)
if(UNIX AND NOT APPLE)
install(TARGETS yuzu-cmd)

View File

@@ -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

View File

@@ -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_HOST/${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_HOST=$(jq -r ".git_host" <<< "$JSON")
[ "$GIT_HOST" == null ] && GIT_HOST=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_HOST/$REPO"
TAG=$(jq -r ".tag" <<< "$JSON")
ARTIFACT=$(jq -r ".artifact" <<< "$JSON")
BRANCH=$(jq -r ".branch" <<< "$JSON")
if [ "$TAG" != "null" ]; then
@@ -156,23 +174,20 @@ do
KEY=$(jq -r ".key" <<< "$JSON")
if [ "$KEY" == null ]; then
VERSION=$(jq -r ".version" <<< "$JSON")
GIT_VERSION=$(jq -r ".git_version" <<< "$JSON")
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