2025-10-28 23:54:45 +01:00
|
|
|
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
2022-07-28 16:44:52 +02:00
|
|
|
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
chore: make yuzu REUSE compliant
[REUSE] is a specification that aims at making file copyright
information consistent, so that it can be both human and machine
readable. It basically requires that all files have a header containing
copyright and licensing information. When this isn't possible, like
when dealing with binary assets, generated files or embedded third-party
dependencies, it is permitted to insert copyright information in the
`.reuse/dep5` file.
Oh, and it also requires that all the licenses used in the project are
present in the `LICENSES` folder, that's why the diff is so huge.
This can be done automatically with `reuse download --all`.
The `reuse` tool also contains a handy subcommand that analyzes the
project and tells whether or not the project is (still) compliant,
`reuse lint`.
Following REUSE has a few advantages over the current approach:
- Copyright information is easy to access for users / downstream
- Files like `dist/license.md` do not need to exist anymore, as
`.reuse/dep5` is used instead
- `reuse lint` makes it easy to ensure that copyright information of
files like binary assets / images is always accurate and up to date
To add copyright information of files that didn't have it I looked up
who committed what and when, for each file. As yuzu contributors do not
have to sign a CLA or similar I couldn't assume that copyright ownership
was of the "yuzu Emulator Project", so I used the name and/or email of
the commit author instead.
[REUSE]: https://reuse.software
Follow-up to b2eb10382941bef0914f4a0a4685b9033440aa9f
2022-05-15 02:06:02 +02:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2020-05-08 15:09:29 -06:00
|
|
|
|
2022-11-25 19:35:46 +01:00
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-05-08 15:09:29 -06:00
|
|
|
|
[cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994)
Requires qt6-static, obviously... at least for eden. eden-cli also can
be built fully static
Notable challenges n such:
1. VkMemAlloc conflicts with Qt, since it embeds vk_mem_alloc.h in
qrhivulkan; we can get around this by conditionally defining
VMA_IMPLEMENTATION; that is, define it in the SDL2 frontend and undef
it in the Qt frontend. It's not ideal, but I mean... it works, no?
2. find_library, pkgconfig, and some Config modules will always look for
a .dll, so we have to tell CMake to look for .a
3. In spite of this, some will end up using .dll.a (implib) as their
link targets; this is, well, bad, so we create a find_library hook
that rejects dll.a
4. Some libraries have specific configs (boost lol)
5. Some libraries use _static targets (zstd, mbedtls)
6. Some extra libraries need to be linked, i.e. jbig, lzma, etc
7. QuaZip is sad
Needs testing on all platforms, and for both frontends on desktop, to
ensure Vulkan still works as expected.
(also: CI). Resulting executables are:
- 71MB for eden.exe
- 39MB for eden-cli.exe
Considering the entire libicudt is included (thanks Qt), that's a great size all things considered. No need to bundle all those plugins and translation files too.
Theoretically, this lays the groundwork towards fully static executables for other platforms too; though Linux doesn't have a huge benefit since AppImages are needed regardless. eden-room though maybe?
Fixes comp for clangarm64 because -msse4.1
Also allows macOS to build with qt6-static. macOS can't build static executables, but with these changes it ONLY relies on system libraries like libc and frameworks. So in theory we don't even need macdeployqt.
Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2994
2025-11-11 06:22:33 +01:00
|
|
|
find_package(zstd QUIET CONFIG)
|
|
|
|
|
if (zstd_CONSIDERED_CONFIGS)
|
|
|
|
|
find_package_handle_standard_args(zstd CONFIG_MODE)
|
|
|
|
|
else()
|
|
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
|
pkg_search_module(ZSTD QUIET IMPORTED_TARGET libzstd)
|
|
|
|
|
find_package_handle_standard_args(zstd
|
|
|
|
|
REQUIRED_VARS ZSTD_LINK_LIBRARIES
|
|
|
|
|
VERSION_VAR ZSTD_VERSION
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2022-12-06 04:17:44 +01:00
|
|
|
|
|
|
|
|
if (zstd_FOUND AND NOT TARGET zstd::zstd)
|
[cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994)
Requires qt6-static, obviously... at least for eden. eden-cli also can
be built fully static
Notable challenges n such:
1. VkMemAlloc conflicts with Qt, since it embeds vk_mem_alloc.h in
qrhivulkan; we can get around this by conditionally defining
VMA_IMPLEMENTATION; that is, define it in the SDL2 frontend and undef
it in the Qt frontend. It's not ideal, but I mean... it works, no?
2. find_library, pkgconfig, and some Config modules will always look for
a .dll, so we have to tell CMake to look for .a
3. In spite of this, some will end up using .dll.a (implib) as their
link targets; this is, well, bad, so we create a find_library hook
that rejects dll.a
4. Some libraries have specific configs (boost lol)
5. Some libraries use _static targets (zstd, mbedtls)
6. Some extra libraries need to be linked, i.e. jbig, lzma, etc
7. QuaZip is sad
Needs testing on all platforms, and for both frontends on desktop, to
ensure Vulkan still works as expected.
(also: CI). Resulting executables are:
- 71MB for eden.exe
- 39MB for eden-cli.exe
Considering the entire libicudt is included (thanks Qt), that's a great size all things considered. No need to bundle all those plugins and translation files too.
Theoretically, this lays the groundwork towards fully static executables for other platforms too; though Linux doesn't have a huge benefit since AppImages are needed regardless. eden-room though maybe?
Fixes comp for clangarm64 because -msse4.1
Also allows macOS to build with qt6-static. macOS can't build static executables, but with these changes it ONLY relies on system libraries like libc and frameworks. So in theory we don't even need macdeployqt.
Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2994
2025-11-11 06:22:33 +01:00
|
|
|
if (TARGET zstd::libzstd_shared AND NOT YUZU_STATIC_BUILD)
|
2022-12-06 04:17:44 +01:00
|
|
|
add_library(zstd::zstd ALIAS zstd::libzstd_shared)
|
|
|
|
|
elseif (TARGET zstd::libzstd_static)
|
|
|
|
|
add_library(zstd::zstd ALIAS zstd::libzstd_static)
|
|
|
|
|
else()
|
|
|
|
|
add_library(zstd::zstd ALIAS PkgConfig::ZSTD)
|
[cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994)
Requires qt6-static, obviously... at least for eden. eden-cli also can
be built fully static
Notable challenges n such:
1. VkMemAlloc conflicts with Qt, since it embeds vk_mem_alloc.h in
qrhivulkan; we can get around this by conditionally defining
VMA_IMPLEMENTATION; that is, define it in the SDL2 frontend and undef
it in the Qt frontend. It's not ideal, but I mean... it works, no?
2. find_library, pkgconfig, and some Config modules will always look for
a .dll, so we have to tell CMake to look for .a
3. In spite of this, some will end up using .dll.a (implib) as their
link targets; this is, well, bad, so we create a find_library hook
that rejects dll.a
4. Some libraries have specific configs (boost lol)
5. Some libraries use _static targets (zstd, mbedtls)
6. Some extra libraries need to be linked, i.e. jbig, lzma, etc
7. QuaZip is sad
Needs testing on all platforms, and for both frontends on desktop, to
ensure Vulkan still works as expected.
(also: CI). Resulting executables are:
- 71MB for eden.exe
- 39MB for eden-cli.exe
Considering the entire libicudt is included (thanks Qt), that's a great size all things considered. No need to bundle all those plugins and translation files too.
Theoretically, this lays the groundwork towards fully static executables for other platforms too; though Linux doesn't have a huge benefit since AppImages are needed regardless. eden-room though maybe?
Fixes comp for clangarm64 because -msse4.1
Also allows macOS to build with qt6-static. macOS can't build static executables, but with these changes it ONLY relies on system libraries like libc and frameworks. So in theory we don't even need macdeployqt.
Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2994
2025-11-11 06:22:33 +01:00
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
get_target_property(ZSTD_TARGET zstd::zstd ALIASED_TARGET)
|
|
|
|
|
|
|
|
|
|
if (NOT TARGET zstd::libzstd)
|
|
|
|
|
if (ZSTD_TARGET)
|
|
|
|
|
add_library(zstd::libzstd ALIAS ${ZSTD_TARGET})
|
|
|
|
|
else()
|
|
|
|
|
add_library(zstd::libzstd ALIAS zstd::zstd)
|
2022-12-06 04:17:44 +01:00
|
|
|
endif()
|
|
|
|
|
endif()
|