eden/CMakeModules
crueter 7ca657d22f
[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
..
CPM.cmake [cmake, tools, docs] Update CPMUtil (#2790) 2025-10-20 03:43:15 +02:00
CPMUtil.cmake [cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994) 2025-11-11 06:22:33 +01:00
CopyYuzuQt6Deps.cmake [qt] Fix title bar for windows being forced to light theme (#236) 2025-08-10 22:14:12 +02:00
DownloadExternals.cmake CMake improvements: ccache, bundled Qt, MoltenVK, LTO, and Linux deps (#2622) 2025-09-30 02:51:48 +02:00
FindDiscordRPC.cmake [dynarmic, qt] fix build with QuaZip <=1.4 and fmt v9 (#2755) 2025-10-17 04:20:11 +02:00
FindFFmpeg.cmake [cmake] account for sysroot when cross compiling for SunOS/FBSD/etc; dynarmic now uses ARCHITECTURE_* from global defs (#2928) 2025-11-03 21:08:48 +01:00
FindLLVM.cmake fix LLVM not using current top level src dir (#30) 2025-07-09 01:31:18 +00:00
FindOpus.cmake [cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994) 2025-11-11 06:22:33 +01:00
FindRenderDoc.cmake cmake: prefer system renderdoc header 2023-09-18 18:35:20 +02:00
FindSPIRV-Tools.cmake [cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994) 2025-11-11 06:22:33 +01:00
FindSimpleIni.cmake cmake: support simpleini cmake config and pc file 2024-01-26 01:13:47 +01:00
Findenet.cmake [cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994) 2025-11-11 06:22:33 +01:00
Findgamemode.cmake cmake: prefer system gamemode library 2023-11-30 16:54:00 +01:00
Findhttplib.cmake cmake: support components in find modules 2023-02-28 17:46:20 +01:00
Findlibiw.cmake Add Airplane Mode + Host Network Interface Details (#204) 2025-06-26 18:55:34 +00:00
Findlibusb.cmake [cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994) 2025-11-11 06:22:33 +01:00
Findlz4.cmake [cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994) 2025-11-11 06:22:33 +01:00
Findstb.cmake cmake: prefer system stb headers 2023-10-25 21:47:32 +02:00
Findzstd.cmake [cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994) 2025-11-11 06:22:33 +01:00
FixMsysPaths.cmake [cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994) 2025-11-11 06:22:33 +01:00
GenerateDepHashes.cmake [cmake, frontend] feat: CPMUtil + dependency viewer (#238) 2025-08-11 22:27:29 +02:00
GenerateSCMRev.cmake [meta] allow customisation of auto-updater, remove hardcoded title names and fix dup title names (#2588) 2025-10-01 05:07:59 +02:00
GetSCMRev.cmake [cmake] fix OpenGL, git rev identifier (#2530) 2025-09-20 22:58:33 +02:00
MinGWClangCross.cmake chore: make yuzu REUSE compliant 2022-07-27 12:53:49 +02:00
MinGWCross.cmake chore: make yuzu REUSE compliant 2022-07-27 12:53:49 +02:00
WindowsCopyFiles.cmake [meta] fix license headers (#2547) 2025-09-21 21:58:59 +02:00
aqt_config.ini Some fixes before Release (#92) 2025-05-08 23:03:52 +00:00