From 0f608328a22f7a4e19b3d4377b4955afe12f063b Mon Sep 17 00:00:00 2001 From: crueter Date: Tue, 13 Jan 2026 23:43:03 -0500 Subject: [PATCH] more cleanups, custom dir support Signed-off-by: crueter --- CMakeLists.txt | 17 +++-- CMakeModules/CPMUtil.cmake | 76 ++++++++++++++++------ docs/CPMUtil/AddCIPackage.md | 21 +++--- docs/CPMUtil/AddJsonPackage.md | 8 +-- docs/CPMUtil/AddPackage.md | 40 ++++++------ docs/CPMUtil/AddQt.md | 2 +- docs/CPMUtil/README.md | 10 +-- externals/CMakeLists.txt | 12 +++- externals/cpmfile.json | 52 +++++++++++++++ externals/ffmpeg/CMakeLists.txt | 2 - externals/ffmpeg/cpmfile.json | 16 ----- externals/libusb/CMakeLists.txt | 2 - externals/libusb/cpmfile.json | 12 ---- externals/nx_tzdb/CMakeLists.txt | 2 - externals/nx_tzdb/cpmfile.json | 11 ---- src/dynarmic/CMakeLists.txt | 4 -- src/dynarmic/externals/CMakeLists.txt | 34 ---------- src/dynarmic/externals/cpmfile.json | 21 ------ src/video_core/host_shaders/CMakeLists.txt | 3 +- tools/cpm/package/which.sh | 2 +- 20 files changed, 173 insertions(+), 174 deletions(-) delete mode 100644 externals/ffmpeg/cpmfile.json delete mode 100644 externals/libusb/cpmfile.json delete mode 100644 externals/nx_tzdb/cpmfile.json delete mode 100644 src/dynarmic/externals/CMakeLists.txt delete mode 100644 src/dynarmic/externals/cpmfile.json diff --git a/CMakeLists.txt b/CMakeLists.txt index ad518c1642..bd3a5a84f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,7 @@ set(EXT_DEFAULT OFF) if (MSVC OR ANDROID) set(EXT_DEFAULT ON) endif() + option(YUZU_USE_CPM "Use CPM to fetch system dependencies (fmt, boost, etc) if needed. Externals will still be fetched." ${EXT_DEFAULT}) # ffmpeg @@ -533,6 +534,11 @@ find_package(SimpleIni) find_package(SPIRV-Tools) find_package(sirit) find_package(gamemode) +find_package(mcl) + +if (ARCHITECTURE_riscv64) + find_package(biscuit) +endif() if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) find_package(xbyak) @@ -615,20 +621,19 @@ if (ENABLE_QT) ## Components ## # Best practice is to ask for all components at once, so they are from the same version - set(YUZU_QT_COMPONENTS2 Core Widgets Concurrent) + set(YUZU_QT_COMPONENTS Core Widgets Concurrent) if (PLATFORM_LINUX) - list(APPEND YUZU_QT_COMPONENTS2 DBus) + list(APPEND YUZU_QT_COMPONENTS DBus) endif() if (YUZU_USE_QT_MULTIMEDIA) - list(APPEND YUZU_QT_COMPONENTS2 Multimedia) + list(APPEND YUZU_QT_COMPONENTS Multimedia) endif() if (YUZU_USE_QT_WEB_ENGINE) - list(APPEND YUZU_QT_COMPONENTS2 WebEngineCore WebEngineWidgets) + list(APPEND YUZU_QT_COMPONENTS WebEngineCore WebEngineWidgets) endif() if (ENABLE_QT_TRANSLATION) - list(APPEND YUZU_QT_COMPONENTS2 LinguistTools) + list(APPEND YUZU_QT_COMPONENTS LinguistTools) endif() - set(YUZU_QT_COMPONENTS ${YUZU_QT_COMPONENTS2} PARENT_SCOPE) find_package(Qt6 REQUIRED COMPONENTS ${YUZU_QT_COMPONENTS}) set(QT_MAJOR_VERSION 6) diff --git a/CMakeModules/CPMUtil.cmake b/CMakeModules/CPMUtil.cmake index 31a9f10fb5..994b415312 100644 --- a/CMakeModules/CPMUtil.cmake +++ b/CMakeModules/CPMUtil.cmake @@ -23,8 +23,17 @@ set(CPMUTIL_JSON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json") if(EXISTS ${CPMUTIL_JSON_FILE}) file(READ ${CPMUTIL_JSON_FILE} CPMFILE_CONTENT) + if (NOT TARGET cpmfiles) + add_custom_target(cpmfiles) + endif() + + target_sources(cpmfiles PRIVATE ${CPMUTIL_JSON_FILE}) + set_property(DIRECTORY APPEND PROPERTY + CMAKE_CONFIGURE_DEPENDS + "${CPMUTIL_JSON_FILE}") else() - message(WARNING "[CPMUtil] cpmfile ${CPMUTIL_JSON_FILE} does not exist, AddJsonPackage will be a no-op") + message(DEBUG "[CPMUtil] cpmfile ${CPMUTIL_JSON_FILE}" + "does not exist, AddJsonPackage will be a no-op") endif() # Utility stuff @@ -68,10 +77,10 @@ function(AddJsonPackage) set(oneValueArgs NAME - # these are overrides that can be generated at runtime, so can be defined separately from the json + # these are overrides that can be generated at runtime, + # so can be defined separately from the json DOWNLOAD_ONLY - BUNDLED_PACKAGE - ) + BUNDLED_PACKAGE) set(multiValueArgs OPTIONS) @@ -86,7 +95,8 @@ function(AddJsonPackage) endif() if(NOT DEFINED CPMFILE_CONTENT) - cpm_utils_message(WARNING ${name} "No cpmfile, AddJsonPackage is a no-op") + cpm_utils_message(WARNING ${name} + "No cpmfile, AddJsonPackage is a no-op") return() endif() @@ -94,7 +104,8 @@ function(AddJsonPackage) cpm_utils_message(FATAL_ERROR "json package" "No name specified") endif() - string(JSON object ERROR_VARIABLE err GET "${CPMFILE_CONTENT}" "${JSON_NAME}") + string(JSON object ERROR_VARIABLE + err GET "${CPMFILE_CONTENT}" "${JSON_NAME}") if(err) cpm_utils_message(FATAL_ERROR ${JSON_NAME} "Not found in cpmfile") @@ -112,7 +123,8 @@ function(AddJsonPackage) get_json_element("${object}" raw_disabled disabled_platforms "") if(raw_disabled) - array_to_list("${raw_disabled}" ${raw_disabled_LENGTH} disabled_platforms) + array_to_list("${raw_disabled}" + ${raw_disabled_LENGTH} disabled_platforms) else() set(disabled_platforms "") endif() @@ -152,8 +164,10 @@ function(AddJsonPackage) 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) + # 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}) @@ -178,9 +192,11 @@ function(AddJsonPackage) foreach(IDX RANGE ${range}) string(JSON _patch GET "${raw_patches}" "${IDX}") - set(full_patch "${CMAKE_SOURCE_DIR}/.patch/${JSON_NAME}/${_patch}") + set(full_patch + "${PROJECT_SOURCE_DIR}/.patch/${JSON_NAME}/${_patch}") if(NOT EXISTS ${full_patch}) - cpm_utils_message(FATAL_ERROR ${JSON_NAME} "specifies patch ${full_patch} which does not exist") + cpm_utils_message(FATAL_ERROR ${JSON_NAME} + "specifies patch ${full_patch} which does not exist") endif() list(APPEND patches "${full_patch}") @@ -289,8 +305,17 @@ function(AddPackage) cpm_utils_message(FATAL_ERROR "package" "No package name defined") endif() - 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}") + set(${PKG_ARGS_NAME}_CUSTOM_DIR "" CACHE STRING + "Path to a separately-downloaded copy of ${PKG_ARGS_NAME}") + 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 (DEFINED ${PKG_ARGS_NAME}_CUSTOM_DIR AND + NOT ${PKG_ARGS_NAME}_CUSTOM_DIR STREQUAL "") + set(CPM_${PKG_ARGS_NAME}_SOURCE ${${PKG_ARGS_NAME}_CUSTOM_DIR}) + endif() if(NOT DEFINED PKG_ARGS_GIT_HOST) set(git_host github.com) @@ -330,14 +355,16 @@ function(AddPackage) set(PKG_BRANCH ${PKG_ARGS_BRANCH}) else() cpm_utils_message(WARNING ${PKG_ARGS_NAME} - "REPO defined but no TAG, SHA, BRANCH, or URL specified, defaulting to master") + "REPO defined but no TAG, SHA, BRANCH, or URL" + "specified, defaulting to master") set(PKG_BRANCH master) endif() set(pkg_url ${pkg_git_url}/archive/refs/heads/${PKG_BRANCH}.tar.gz) endif() else() - cpm_utils_message(FATAL_ERROR ${PKG_ARGS_NAME} "No URL or repository defined") + cpm_utils_message(FATAL_ERROR ${PKG_ARGS_NAME} + "No URL or repository defined") endif() cpm_utils_message(DEBUG ${PKG_ARGS_NAME} "Download URL is ${pkg_url}") @@ -399,7 +426,8 @@ function(AddPackage) # because "technically" the hash is invalidated each week # but it works for now kjsdnfkjdnfjksdn string(TOLOWER ${PKG_ARGS_NAME} lowername) - if(NOT EXISTS ${outfile} AND NOT EXISTS ${CPM_SOURCE_CACHE}/${lowername}/${pkg_key}) + if(NOT EXISTS ${outfile} AND NOT EXISTS + ${CPM_SOURCE_CACHE}/${lowername}/${pkg_key}) file(DOWNLOAD ${hash_url} ${outfile}) endif() @@ -425,7 +453,7 @@ function(AddPackage) - CPMUTIL_FORCE_BUNDLED - BUNDLED_PACKAGE - default to allow local - ]] # + ]] if(PKG_ARGS_FORCE_BUNDLED_PACKAGE) set_precedence(OFF OFF) elseif(${PKG_ARGS_NAME}_FORCE_SYSTEM) @@ -436,7 +464,8 @@ function(AddPackage) set_precedence(ON ON) elseif(CPMUTIL_FORCE_BUNDLED) set_precedence(OFF OFF) - elseif(DEFINED PKG_ARGS_BUNDLED_PACKAGE AND NOT PKG_ARGS_BUNDLED_PACKAGE STREQUAL "unset") + elseif(DEFINED PKG_ARGS_BUNDLED_PACKAGE AND + NOT PKG_ARGS_BUNDLED_PACKAGE STREQUAL "unset") if(PKG_ARGS_BUNDLED_PACKAGE) set(local OFF) else() @@ -526,7 +555,11 @@ function(AddCIPackage) set(optionArgs MODULE) - cmake_parse_arguments(PKG_ARGS "${optionArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(PKG_ARGS + "${optionArgs}" + "${oneValueArgs}" + "${multiValueArgs}" + ${ARGN}) if(NOT DEFINED PKG_ARGS_VERSION) message(FATAL_ERROR "[CPMUtil] VERSION is required") @@ -607,10 +640,11 @@ function(AddCIPackage) DOWNLOAD_ONLY ${PKG_ARGS_MODULE}) set(${ARTIFACT_PACKAGE}_ADDED TRUE PARENT_SCOPE) - set(${ARTIFACT_PACKAGE}_SOURCE_DIR "${${ARTIFACT_PACKAGE}_SOURCE_DIR}" PARENT_SCOPE) + set(${ARTIFACT_PACKAGE}_SOURCE_DIR + "${${ARTIFACT_PACKAGE}_SOURCE_DIR}" PARENT_SCOPE) if (PKG_ARGS_MODULE) - list(PREPEND CMAKE_PREFIX_PATH "${${ARTIFACT_PACKAGE}_SOURCE_DIR}") + list(APPEND CMAKE_PREFIX_PATH "${${ARTIFACT_PACKAGE}_SOURCE_DIR}") set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE) endif() else() diff --git a/docs/CPMUtil/AddCIPackage.md b/docs/CPMUtil/AddCIPackage.md index bcd72e10da..bc7c1ccfad 100644 --- a/docs/CPMUtil/AddCIPackage.md +++ b/docs/CPMUtil/AddCIPackage.md @@ -7,13 +7,14 @@ - `EXTENSION`: Artifact extension (default `tar.zst`) - `MIN_VERSION`: Minimum version for `find_package`. Only used if platform does not support this package as a bundled artifact - `DISABLED_PLATFORMS`: List of platforms that lack artifacts for this package. Options: - * `windows-amd64` - * `windows-arm64` - * `mingw-amd64` - * `mingw-arm64` - * `android` - * `solaris-amd64` - * `freebsd-amd64` - * `linux-amd64` - * `linux-aarch64` - * `macos-universal` \ No newline at end of file + - `windows-amd64` + - `windows-arm64` + - `mingw-amd64` + - `mingw-arm64` + - `android-x86_64` + - `android-aarch64` + - `solaris-amd64` + - `freebsd-amd64` + - `linux-amd64` + - `linux-aarch64` + - `macos-universal` diff --git a/docs/CPMUtil/AddJsonPackage.md b/docs/CPMUtil/AddJsonPackage.md index d8719eec0a..464cd1731b 100644 --- a/docs/CPMUtil/AddJsonPackage.md +++ b/docs/CPMUtil/AddJsonPackage.md @@ -22,11 +22,11 @@ If `ci` is `false`: - `sha` -> `SHA` - `key` -> `KEY` - `tag` -> `TAG` - * If the tag contains `%VERSION%`, that part will be replaced by the `git_version`, OR `version` if `git_version` is not specified + - If the tag contains `%VERSION%`, that part will be replaced by the `git_version`, OR `version` if `git_version` is not specified - `url` -> `URL` - `artifact` -> `ARTIFACT` - * If the artifact contains `%VERSION%`, that part will be replaced by the `git_version`, OR `version` if `git_version` is not specified - * If the artifact contains `%TAG%`, that part will be replaced by the `tag` (with its replacement already done) + - If the artifact contains `%VERSION%`, that part will be replaced by the `git_version`, OR `version` if `git_version` is not specified + - If the artifact contains `%TAG%`, that part will be replaced by the `tag` (with its replacement already done) - `git_version` -> `GIT_VERSION` - `git_host` -> `GIT_HOST` - `source_subdir` -> `SOURCE_SUBDIR` @@ -101,4 +101,4 @@ In order: OpenSSL CI, Boost (tag + artifact), Opus (options + find_args), discor ] } } -``` \ No newline at end of file +``` diff --git a/docs/CPMUtil/AddPackage.md b/docs/CPMUtil/AddPackage.md index 410c84a958..6e9ae1b775 100644 --- a/docs/CPMUtil/AddPackage.md +++ b/docs/CPMUtil/AddPackage.md @@ -17,7 +17,7 @@ - `URL`: The URL to fetch. - `REPO`: The repo to use (`owner/repo`). - `GIT_HOST`: The Git host to use - * Defaults to `github.com`. Do not include the protocol, as HTTPS is enforced. + - Defaults to `github.com`. Do not include the protocol, as HTTPS is enforced. - `TAG`: The tag to fetch, if applicable. - `ARTIFACT`: The name of the artifact, if applicable. - `SHA`: Commit sha to fetch, if applicable. @@ -26,23 +26,23 @@ The following configurations are supported, in descending order of precedence: - `URL`: Bare URL download, useful for custom artifacts - * If this is set, `GIT_URL` or `REPO` should be set to allow the dependency viewer to link to the project's Git repository. - * If this is NOT set, `REPO` must be defined. + - If this is set, `GIT_URL` or `REPO` should be set to allow the dependency viewer to link to the project's Git repository. + - If this is NOT set, `REPO` must be defined. - `REPO + TAG + ARTIFACT`: GitHub release artifact - * The final download URL will be `https://github.com/${REPO}/releases/download/${TAG}/${ARTIFACT}` - * Useful for prebuilt libraries and prefetched archives + - The final download URL will be `https://github.com/${REPO}/releases/download/${TAG}/${ARTIFACT}` + - Useful for prebuilt libraries and prefetched archives - `REPO + TAG`: GitHub tag archive - * The final download URL will be `https://github.com/${REPO}/archive/refs/tags/${TAG}.tar.gz` - * Useful for pinning to a specific tag, better for build identification + - The final download URL will be `https://github.com/${REPO}/archive/refs/tags/${TAG}.tar.gz` + - Useful for pinning to a specific tag, better for build identification - `REPO + SHA`: GitHub commit archive - * The final download URL will be `https://github.com/${REPO}/archive/${SHA}.zip` - * Useful for pinning to a specific commit + - The final download URL will be `https://github.com/${REPO}/archive/${SHA}.zip` + - Useful for pinning to a specific commit - `REPO + BRANCH`: GitHub branch archive - * The final download URL will be `https://github.com/${REPO}/archive/refs/heads/${BRANCH}.zip` - * Generally not recommended unless the branch is frozen + - The final download URL will be `https://github.com/${REPO}/archive/refs/heads/${BRANCH}.zip` + - Generally not recommended unless the branch is frozen - `REPO`: GitHub master archive - * The final download URL will be `https://github.com/${REPO}/archive/refs/heads/master.zip` - * Generally not recommended unless the project is dead + - The final download URL will be `https://github.com/${REPO}/archive/refs/heads/master.zip` + - Generally not recommended unless the project is dead ## Hashing @@ -54,20 +54,20 @@ Hashing strategies, descending order of precedence: - `HASH`: Bare hash verification, useful for static downloads e.g. commit archives - `HASH_SUFFIX`: Download the hash as `${DOWNLOAD_URL}.${HASH_SUFFIX}` - * The downloaded hash *must* match the hash algorithm and contain nothing but the hash; no filenames or extra content. + - The downloaded hash *must* match the hash algorithm and contain nothing but the hash; no filenames or extra content. - `HASH_URL`: Download the hash from a separate URL ## Other Options - `KEY`: Custom cache key to use (stored as `.cache/cpm/${packagename_lower}/${key}`) - * Default is based on, in descending order of precedence: + - Default is based on, in descending order of precedence: - First 4 characters of the sha - `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 + - Useful to turn `OFF` if the project doesn't use CMake - `SOURCE_SUBDIR`: Subdirectory of the project containing a CMakeLists.txt file - `FIND_PACKAGE_ARGUMENTS`: Arguments to pass to the `find_package` call - `BUNDLED_PACKAGE`: Set to `ON` to default to the bundled package @@ -80,12 +80,14 @@ Hashing strategies, descending order of precedence: For each added package, users may additionally force usage of the system/bundled package. +- `${package}_DIR`: Path to a separately-downloaded copy of the package. Note that versioning is not checked! - `${package}_FORCE_SYSTEM`: Require the package to be installed on the system - `${package}_FORCE_BUNDLED`: Force the package to be fetched and use the bundled version ## System/Bundled Packages Descending order of precedence: + - If `${package}_FORCE_SYSTEM` is true, requires the package to be on the system - If `${package}_FORCE_BUNDLED` is true, forcefully uses the bundled package - If `CPMUTIL_FORCE_SYSTEM` is true, requires the package to be on the system @@ -101,8 +103,8 @@ URLs: - `GIT_URL` - `REPO` as a Git repository - * You may optionally specify `GIT_HOST` to use a custom host, e.g. `GIT_HOST git.crueter.xyz`. Note that the git host MUST be GitHub-like in its artifact/archive downloads, e.g. Forgejo - * If `GIT_HOST` is unspecified, defaults to `github.com` + - You may optionally specify `GIT_HOST` to use a custom host, e.g. `GIT_HOST git.crueter.xyz`. Note that the git host MUST be GitHub-like in its artifact/archive downloads, e.g. Forgejo + - If `GIT_HOST` is unspecified, defaults to `github.com` - `URL` Versions (bundled): @@ -113,4 +115,4 @@ Versions (bundled): - `TAG` - "unknown" -If the package is a system package, AddPackage will attempt to determine the package version and append ` (system)` to the identifier. Otherwise, it will be marked as `unknown (system)` +If the package is a system package, AddPackage will attempt to determine the package version and append `(system)` to the identifier. Otherwise, it will be marked as `unknown (system)` diff --git a/docs/CPMUtil/AddQt.md b/docs/CPMUtil/AddQt.md index 2c8c2624fb..e9595b8004 100644 --- a/docs/CPMUtil/AddQt.md +++ b/docs/CPMUtil/AddQt.md @@ -25,4 +25,4 @@ The following versions have available builds: - 6.9.3 -See [here](https://github.com/crueter-ci/Qt) for an updated list at any time. \ No newline at end of file +See [`crueter-ci/Qt`](https://github.com/crueter-ci/Qt) for an updated list at any time. diff --git a/docs/CPMUtil/README.md b/docs/CPMUtil/README.md index 4ce6e1bf92..ff19cb4f76 100644 --- a/docs/CPMUtil/README.md +++ b/docs/CPMUtil/README.md @@ -5,7 +5,7 @@ CPMUtil is a wrapper around CPM that aims to reduce boilerplate and add useful u Global Options: - `CPMUTIL_FORCE_SYSTEM` (default `OFF`): Require all CPM dependencies to use system packages. NOT RECOMMENDED! - * You may optionally override this (section) + - You may optionally override this (section) - `CPMUTIL_FORCE_BUNDLED` (default `ON` on MSVC and Android, `OFF` elsewhere): Require all CPM dependencies to use bundled packages. You are highly encouraged to read AddPackage first, even if you plan to only interact with CPMUtil via `AddJsonPackage`. @@ -42,8 +42,8 @@ CPMUtil will create three lists of dependencies where `AddPackage` or similar wa - `CPM_PACKAGE_NAMES`: The names of packages included by CPMUtil - `CPM_PACKAGE_URLS`: The URLs to project/repo pages of packages - `CPM_PACKAGE_SHAS`: Short version identifiers for each package - * If the package was included as a system package, ` (system)` is appended thereafter - * Packages whose versions can't be deduced will be left as `unknown`. + - If the package was included as a system package, `(system)` is appended thereafter + - Packages whose versions can't be deduced will be left as `unknown`. For an example of how this might be implemented in an application, see Eden's implementation: @@ -59,6 +59,8 @@ If you are packaging a project that uses CPMUtil, read this! For sandboxed environments (e.g. Gentoo, nixOS) you must install all dependencies to the system beforehand and set `-DCPMUTIL_FORCE_SYSTEM=ON`. If a dependency is missing, get creating! +Alternatively, if CPMUtil pulls in a package that has no suitable way to install or use a system version, download it separately and pass `-DPackageName_DIR=/path/to/downloaded/dir` (e.g. shaders) + ### Unsandboxed -For others (AUR, MPR, etc). CPMUtil will handle everything for you, including if some of the project's dependencies are missing from your distribution's repositories. That is pretty much half the reason I created this behemoth, after all. \ No newline at end of file +For others (AUR, MPR, etc). CPMUtil will handle everything for you, including if some of the project's dependencies are missing from your distribution's repositories. That is pretty much half the reason I created this behemoth, after all. diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 18491962b2..185be585d3 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -25,7 +25,7 @@ set(BUILD_SHARED_LIBS OFF) # Skip install rules for all externals set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL ON) -# Xbyak (also used by Dynarmic, so needs to be added first) +# Xbyak if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) if (PLATFORM_SUN OR PLATFORM_OPENBSD OR PLATFORM_NETBSD OR PLATFORM_DRAGONFLY) AddJsonPackage(xbyak_sun) @@ -34,11 +34,19 @@ if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) endif() endif() -# Oaknut (also used by Dynarmic, so needs to be added first) +# Oaknut if (ARCHITECTURE_arm64 OR DYNARMIC_TESTS) AddJsonPackage(oaknut) endif() +# biscuit +if (ARCHITECTURE_riscv64) + AddJsonPackage(biscuit) +endif() + +# mcl +AddJsonPackage(mcl) + # enet AddJsonPackage(enet) diff --git a/externals/cpmfile.json b/externals/cpmfile.json index 4cb5ef6855..7ff4fb4eae 100644 --- a/externals/cpmfile.json +++ b/externals/cpmfile.json @@ -225,5 +225,57 @@ "hash": "e87ec14ed3e826d578ebf095c41580069dda603792ba91efa84f45f4571a28f4d91889675055fd6f042d7dc25b0b9443daf70963ae463e38b11bcba95f4c65a9", "version": "1.7", "find_args": "MODULE" + }, + "biscuit": { + "repo": "lioncash/biscuit", + "tag": "v%VERSION%", + "hash": "1229f345b014f7ca544dedb4edb3311e41ba736f9aa9a67f88b5f26f3c983288c6bb6cdedcfb0b8a02c63088a37e6a0d7ba97d9c2a4d721b213916327cffe28a", + "version": "0.9.1", + "git_version": "0.19.0" + }, + "mcl": { + "version": "0.1.12", + "repo": "azahar-emu/mcl", + "sha": "7b08d83418", + "hash": "9c6ba624cb22ef622f78046a82abb99bf5026284ba17dfacaf46ac842cbd3b0f515f5ba45a1598c7671318a78a2e648db72ce8d10e7537f34e39800bdcb57694", + "options": [ + "MCL_INSTALL OFF" + ], + "patches": [ + "0001-assert-macro.patch" + ] + }, + "libusb": { + "repo": "libusb/libusb", + "tag": "v%VERSION%", + "hash": "98c5f7940ff06b25c9aa65aa98e23de4c79a4c1067595f4c73cc145af23a1c286639e1ba11185cd91bab702081f307b973f08a4c9746576dc8d01b3620a3aeb5", + "find_args": "MODULE", + "git_version": "1.0.29", + "patches": [ + "0001-netbsd-gettime.patch" + ] + }, + "ffmpeg": { + "repo": "FFmpeg/FFmpeg", + "sha": "5e56937b74", + "hash": "9ab0457dcd6ce6359b5053c1662f57910d332f68ca0cca9d4134d858464840917027374de3d97e0863c3a7daaea2fe4f4cd17d1c6d8e7f740f4ad91e71c2932b", + "bundled": true + }, + "ffmpeg-ci": { + "ci": true, + "package": "FFmpeg", + "name": "ffmpeg", + "repo": "crueter-ci/FFmpeg", + "version": "8.0.1-5e56937b74", + "min_version": "4.1" + }, + "tzdb": { + "package": "nx_tzdb", + "repo": "misc/tzdb_to_nx", + "git_host": "git.crueter.xyz", + "artifact": "%VERSION%.tar.gz", + "tag": "%VERSION%", + "hash": "dc37a189a44ce8b5c988ca550582431a6c7eadfd3c6e709bee6277116ee803e714333e85c9e6cbb5c69346a14d6f2cc7ed96e8aa09cc5fb8a89f945059651db6", + "version": "121125" } } diff --git a/externals/ffmpeg/CMakeLists.txt b/externals/ffmpeg/CMakeLists.txt index 14438f1229..3140f8e545 100644 --- a/externals/ffmpeg/CMakeLists.txt +++ b/externals/ffmpeg/CMakeLists.txt @@ -4,8 +4,6 @@ # SPDX-FileCopyrightText: 2021 yuzu Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later -include(CPMUtil) - # TODO(crueter, MaranBr): Externals FFmpeg 8.0 set(FFmpeg_HWACCEL_LIBRARIES) diff --git a/externals/ffmpeg/cpmfile.json b/externals/ffmpeg/cpmfile.json deleted file mode 100644 index 405d060411..0000000000 --- a/externals/ffmpeg/cpmfile.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "ffmpeg": { - "repo": "FFmpeg/FFmpeg", - "sha": "5e56937b74", - "hash": "9ab0457dcd6ce6359b5053c1662f57910d332f68ca0cca9d4134d858464840917027374de3d97e0863c3a7daaea2fe4f4cd17d1c6d8e7f740f4ad91e71c2932b", - "bundled": true - }, - "ffmpeg-ci": { - "ci": true, - "package": "FFmpeg", - "name": "ffmpeg", - "repo": "crueter-ci/FFmpeg", - "version": "8.0.1-5e56937b74", - "min_version": "4.1" - } -} diff --git a/externals/libusb/CMakeLists.txt b/externals/libusb/CMakeLists.txt index a53464ea98..7eae81d3b6 100644 --- a/externals/libusb/CMakeLists.txt +++ b/externals/libusb/CMakeLists.txt @@ -4,8 +4,6 @@ # SPDX-FileCopyrightText: 2020 yuzu Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later -include(CPMUtil) - AddJsonPackage(libusb) if (NOT libusb_ADDED) diff --git a/externals/libusb/cpmfile.json b/externals/libusb/cpmfile.json deleted file mode 100644 index 4abe225ab3..0000000000 --- a/externals/libusb/cpmfile.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "libusb": { - "repo": "libusb/libusb", - "tag": "v%VERSION%", - "hash": "98c5f7940ff06b25c9aa65aa98e23de4c79a4c1067595f4c73cc145af23a1c286639e1ba11185cd91bab702081f307b973f08a4c9746576dc8d01b3620a3aeb5", - "find_args": "MODULE", - "git_version": "1.0.29", - "patches": [ - "0001-netbsd-gettime.patch" - ] - } -} diff --git a/externals/nx_tzdb/CMakeLists.txt b/externals/nx_tzdb/CMakeLists.txt index efb3e2b058..b9aa50acd5 100644 --- a/externals/nx_tzdb/CMakeLists.txt +++ b/externals/nx_tzdb/CMakeLists.txt @@ -4,8 +4,6 @@ # SPDX-FileCopyrightText: 2023 yuzu Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later -include(CPMUtil) - set(NX_TZDB_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include") add_library(nx_tzdb INTERFACE) diff --git a/externals/nx_tzdb/cpmfile.json b/externals/nx_tzdb/cpmfile.json deleted file mode 100644 index 908201564f..0000000000 --- a/externals/nx_tzdb/cpmfile.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "tzdb": { - "package": "nx_tzdb", - "repo": "misc/tzdb_to_nx", - "git_host": "git.crueter.xyz", - "artifact": "%VERSION%.tar.gz", - "tag": "%VERSION%", - "hash": "dc37a189a44ce8b5c988ca550582431a6c7eadfd3c6e709bee6277116ee803e714333e85c9e6cbb5c69346a14d6f2cc7ed96e8aa09cc5fb8a89f945059651db6", - "version": "121125" - } -} diff --git a/src/dynarmic/CMakeLists.txt b/src/dynarmic/CMakeLists.txt index e05757b6ca..5d0905dde1 100644 --- a/src/dynarmic/CMakeLists.txt +++ b/src/dynarmic/CMakeLists.txt @@ -115,10 +115,6 @@ endif() find_package(Boost 1.57 REQUIRED) find_package(fmt 8 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) diff --git a/src/dynarmic/externals/CMakeLists.txt b/src/dynarmic/externals/CMakeLists.txt deleted file mode 100644 index 1956499464..0000000000 --- a/src/dynarmic/externals/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# 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 -set(BUILD_SHARED_LIBS OFF) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL ON) - -# Allow options shadowing with normal variables when subproject use old cmake policy -set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) - -# Disable tests in all externals supporting the standard option name -set(BUILD_TESTING OFF) - -# For libraries that already come with a CMakeLists file, -# simply add the directory to that file as a subdirectory -# to have CMake automatically recognize them. - -# biscuit - -if ("riscv" IN_LIST ARCHITECTURE) - AddJsonPackage( - NAME biscuit - BUNDLED_PACKAGE ${DYNARMIC_USE_BUNDLED_EXTERNALS} - ) -endif() - -# mcl -AddJsonPackage( - NAME mcl - BUNDLED_PACKAGE ${DYNARMIC_USE_BUNDLED_EXTERNALS} -) diff --git a/src/dynarmic/externals/cpmfile.json b/src/dynarmic/externals/cpmfile.json deleted file mode 100644 index 584e1f9115..0000000000 --- a/src/dynarmic/externals/cpmfile.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "biscuit": { - "repo": "lioncash/biscuit", - "tag": "v%VERSION%", - "hash": "1229f345b014f7ca544dedb4edb3311e41ba736f9aa9a67f88b5f26f3c983288c6bb6cdedcfb0b8a02c63088a37e6a0d7ba97d9c2a4d721b213916327cffe28a", - "version": "0.9.1", - "git_version": "0.19.0" - }, - "mcl": { - "version": "0.1.12", - "repo": "azahar-emu/mcl", - "sha": "7b08d83418", - "hash": "9c6ba624cb22ef622f78046a82abb99bf5026284ba17dfacaf46ac842cbd3b0f515f5ba45a1598c7671318a78a2e648db72ce8d10e7537f34e39800bdcb57694", - "options": [ - "MCL_INSTALL OFF" - ], - "patches": [ - "0001-assert-macro.patch" - ] - } -} diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt index 2a1bdca3ea..9ce2ac44bf 100644 --- a/src/video_core/host_shaders/CMakeLists.txt +++ b/src/video_core/host_shaders/CMakeLists.txt @@ -88,8 +88,7 @@ set(SHADER_FILES ) if (PLATFORM_HAIKU) - # glslangValidator WILL crash, glslang will not - why? Who the fuck knows - #/boot/home/glslang/build/StandAlone/glslangValidator + # glslangValidator WILL crash, glslang will not set(GLSLANGVALIDATOR "glslang") else() # Normal sane platform who doesn't have a CRASHING glslangValidator diff --git a/tools/cpm/package/which.sh b/tools/cpm/package/which.sh index 650e725c64..24c80760e3 100755 --- a/tools/cpm/package/which.sh +++ b/tools/cpm/package/which.sh @@ -7,6 +7,6 @@ JSON=$(echo "$CPMFILES" | xargs grep -l "\"$1\"") -[ -n "$JSON" ] || echo "!! No cpmfile definition for $1" >&2 && exit 1 +[ -n "$JSON" ] || { echo "!! No cpmfile definition for $1" >&2 && exit 1; } echo "$JSON"