Browse Source
[cmake] allow static MinGW/macOS builds; fix clangarm64 (#2994)
[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/2994pull/3002/head
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
25 changed files with 296 additions and 50 deletions
-
99CMakeLists.txt
-
5CMakeModules/CPMUtil.cmake
-
7CMakeModules/FindOpus.cmake
-
7CMakeModules/FindSPIRV-Tools.cmake
-
7CMakeModules/Findenet.cmake
-
7CMakeModules/Findlibusb.cmake
-
8CMakeModules/Findlz4.cmake
-
20CMakeModules/Findzstd.cmake
-
21CMakeModules/FixMsysPaths.cmake
-
2externals/ffmpeg/CMakeLists.txt
-
3externals/ffmpeg/cpmfile.json
-
22src/CMakeLists.txt
-
2src/android/app/src/main/jni/native.cpp
-
2src/common/CMakeLists.txt
-
8src/core/CMakeLists.txt
-
5src/dedicated_room/CMakeLists.txt
-
9src/tests/CMakeLists.txt
-
6src/tests/common/bit_field.cpp
-
4src/video_core/CMakeLists.txt
-
6src/video_core/vulkan_common/vma.cpp
-
44src/yuzu/CMakeLists.txt
-
18src/yuzu/main_window.cpp
-
9src/yuzu_cmd/CMakeLists.txt
-
6src/yuzu_cmd/yuzu.cpp
-
5src/yuzu_room_standalone/CMakeLists.txt
@ -0,0 +1,21 @@ |
|||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
|||
# SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
function(FixMsysPath target) |
|||
get_target_property(include_dir ${target} INTERFACE_INCLUDE_DIRECTORIES) |
|||
|
|||
if (NOT (include_dir MATCHES "^/")) |
|||
return() |
|||
endif() |
|||
|
|||
set(root_default $ENV{MSYS2_LOCATION}) |
|||
if (root_default STREQUAL "") |
|||
set(root_default "C:/msys64") |
|||
endif() |
|||
|
|||
set(MSYS_ROOT_PATH ${root_default} CACHE STRING "Location of the MSYS2 root") |
|||
|
|||
set(include_dir "C:/msys64${include_dir}") |
|||
set_target_properties(${target} PROPERTIES |
|||
INTERFACE_INCLUDE_DIRECTORIES ${include_dir}) |
|||
endfunction() |
|||
@ -1,6 +0,0 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#define VMA_IMPLEMENTATION
|
|||
|
|||
#include "video_core/vulkan_common/vma.h"
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue