Compare commits

..

10 commits

Author SHA1 Message Date
92de4aee3c
[cmake] fix breakpad fetching
Signed-off-by: crueter <crueter@eden-emu.dev>
2025-09-07 19:39:35 -04:00
2ca36e1bd7
[doc] fix line endings and update macos
All checks were successful
eden-license / license-header (pull_request) Successful in 33s
Signed-off-by: crueter <crueter@eden-emu.dev>
2025-09-07 19:16:06 -04:00
911ace690f
[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>
2025-09-07 19:16:06 -04:00
9e313227be
oops
Signed-off-by: crueter <crueter@eden-emu.dev>
2025-09-07 19:16:06 -04:00
1399f32cf3
[ci] update header script for cmake
Signed-off-by: crueter <crueter@eden-emu.dev>
2025-09-07 19:16:06 -04:00
32024e4708
[cmake] chore: clean up linking, definitions, etc
general clean up of the currently very poorly organized linking/compile
def system. This is very incomplete and needs further work, but chances
are qt_common will mess with it so I will probably merge this into
qt_common.

Signed-off-by: crueter <crueter@eden-emu.dev>
2025-09-07 19:16:06 -04:00
da0823f46f
[cmake, doc] update freebsd docs & fix ext and bundled defaults
Signed-off-by: crueter <crueter@eden-emu.dev>
2025-09-07 19:16:06 -04:00
48ee7afce1
[cmake] Fix FreeBSD building process again 2025-09-07 19:16:06 -04:00
f6e47c8c97
Fix license headers 2025-09-07 19:15:58 -04:00
8cb98b0c41
[breakpad] enable Solaris crash dumps
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-09-07 19:15:58 -04:00
16 changed files with 107 additions and 70 deletions

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
# 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

@ -439,6 +439,14 @@ 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)
@ -544,7 +552,6 @@ add_subdirectory(externals)
# pass targets from externals
find_package(VulkanUtilityLibraries)
find_package(libusb)
find_package(VulkanMemoryAllocator)
find_package(SPIRV-Tools)

View file

@ -27,7 +27,8 @@ option(CPMUTIL_FORCE_SYSTEM
cmake_minimum_required(VERSION 3.22)
include(CPM)
set(CPMUTIL_JSON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json")
# 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")
if (EXISTS ${CPMUTIL_JSON_FILE})
file(READ ${CPMUTIL_JSON_FILE} CPMFILE_CONTENT)

View file

@ -233,9 +233,12 @@ 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):
@ -243,8 +246,8 @@ include(CPMUtil)
- To prefetch all CPM dependencies:
* `tools/cpm-fetch-all.sh`
Currently, `cpm-fetch.sh` defines the following directories for cpmfiles (max depth of 2, so subdirs are caught as well):
Currently, `cpm-fetch.sh` defines the following directories for cpmfiles:
`externals src/yuzu src/dynarmic .`
`externals src/yuzu/externals externals/ffmpeg src/dynarmic/externals externals/nx_tzdb`
Whenever you add a new cpmfile, update the script accordingly

View file

@ -10,6 +10,8 @@
# 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
@ -68,7 +70,43 @@ if (mbedtls_ADDED)
endif()
# libusb
if (ENABLE_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()

View file

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

View file

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

1
externals/libusb/libusb vendored Submodule

@ -0,0 +1 @@
Subproject commit c060e9ce30ac2e3ffb49d94209c4dae77b6642f7

View file

@ -4,6 +4,8 @@
# 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

@ -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 video_core)
target_link_libraries(yuzu-android PRIVATE audio_core common core input_common frontend_common Vulkan::Headers GPUOpen::VulkanMemoryAllocator)
target_link_libraries(yuzu-android PRIVATE android camera2ndk EGL glad jnigraphics log)
if (ARCHITECTURE_arm64)
target_link_libraries(yuzu-android PRIVATE adrenotools)

View file

@ -152,20 +152,12 @@ 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)
@ -184,6 +176,9 @@ 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,6 +1,8 @@
# 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)
# Always build externals as static libraries, even when dynarmic is built as shared

View file

@ -11,12 +11,6 @@
#include "dynarmic/backend/x64/hostloc.h"
#include "dynarmic/common/spin_lock.h"
#ifdef DYNARMIC_ENABLE_NO_EXECUTE_SUPPORT
static const auto default_cg_mode = Xbyak::DontSetProtectRWE;
#else
static const auto default_cg_mode = nullptr; //Allow RWE
#endif
namespace Dynarmic {
void EmitSpinLockLock(Xbyak::CodeGenerator& code, Xbyak::Reg64 ptr, Xbyak::Reg32 tmp) {
@ -43,7 +37,7 @@ namespace {
struct SpinLockImpl {
void Initialize();
Xbyak::CodeGenerator code = Xbyak::CodeGenerator(4096, default_cg_mode);
Xbyak::CodeGenerator code = Xbyak::CodeGenerator(4096, Xbyak::DontSetProtectRWE);
void (*lock)(volatile int*);
void (*unlock)(volatile int*);

View file

@ -1,6 +1,8 @@
# 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

@ -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://$GIT_HOST/${REPO}/releases/download/v${VERSION}/${FILENAME}"
DOWNLOAD="https://$GIT_URL/${REPO}/releases/download/v${VERSION}/${FILENAME}"
PACKAGE_NAME="$PACKAGE"
KEY=$platform
@ -122,9 +122,9 @@ do
URL=$(jq -r ".url" <<< "$JSON")
REPO=$(jq -r ".repo" <<< "$JSON")
SHA=$(jq -r ".sha" <<< "$JSON")
GIT_HOST=$(jq -r ".git_host" <<< "$JSON")
GIT_URL=$(jq -r ".git_url" <<< "$JSON")
[ "$GIT_HOST" == null ] && GIT_HOST=github.com
[ "$GIT_URL" == null ] && GIT_URL=github.com
VERSION=$(jq -r ".version" <<< "$JSON")
GIT_VERSION=$(jq -r ".git_version" <<< "$JSON")
@ -146,7 +146,7 @@ do
if [ "$URL" != "null" ]; then
DOWNLOAD="$URL"
elif [ "$REPO" != "null" ]; then
GIT_URL="https://$GIT_HOST/$REPO"
GIT_URL="https://$GIT_URL/$REPO"
BRANCH=$(jq -r ".branch" <<< "$JSON")