aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcrueter <crueter@eden-emu.dev>2026-01-28 23:54:49 +0100
committercrueter <crueter@eden-emu.dev>2026-01-28 23:54:49 +0100
commit84839dec382d2ac6799194650f194b02db50a616 (patch)
tree68004bfa736d58e5f750036411e2bc3e2763c0f9 /src
parent3b81d2e33367a888d211a36d8ffc7cdfd9640f52 (diff)
[cmake] add a `YUZU_STATIC_ROOM` option (#3411)
Lets you build ONLY the necessary targets to get a statically linked room executable. Only intended to be used on musl targets due to getaddrinfo et al. Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3411 Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt27
-rw-r--r--src/common/logging/text_formatter.cpp2
-rw-r--r--src/yuzu_room_standalone/CMakeLists.txt10
3 files changed, 24 insertions, 15 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6cafe4882a..014134c14e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,7 +7,7 @@
include_directories(.)
# Dynarmic
-if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
+if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64 AND NOT YUZU_STATIC_ROOM)
add_subdirectory(dynarmic)
add_library(dynarmic::dynarmic ALIAS dynarmic)
endif()
@@ -201,19 +201,29 @@ else()
endif()
add_subdirectory(common)
+add_subdirectory(network)
+
+if (YUZU_ROOM)
+ add_subdirectory(dedicated_room)
+endif()
+
+if (YUZU_ROOM_STANDALONE)
+ add_subdirectory(yuzu_room_standalone)
+ set_target_properties(yuzu-room PROPERTIES OUTPUT_NAME "eden-room")
+endif()
+
+if (YUZU_STATIC_ROOM)
+ return()
+endif()
+
add_subdirectory(core)
add_subdirectory(audio_core)
add_subdirectory(video_core)
add_subdirectory(hid_core)
-add_subdirectory(network)
add_subdirectory(input_common)
add_subdirectory(frontend_common)
add_subdirectory(shader_recompiler)
-if (YUZU_ROOM)
- add_subdirectory(dedicated_room)
-endif()
-
if (YUZU_TESTS)
add_subdirectory(tests)
endif()
@@ -223,11 +233,6 @@ if (ENABLE_SDL2 AND YUZU_CMD)
set_target_properties(yuzu-cmd PROPERTIES OUTPUT_NAME "eden-cli")
endif()
-if (YUZU_ROOM_STANDALONE)
- add_subdirectory(yuzu_room_standalone)
- set_target_properties(yuzu-room PROPERTIES OUTPUT_NAME "eden-room")
-endif()
-
if (ENABLE_QT)
add_definitions(-DYUZU_QT_WIDGETS)
add_subdirectory(qt_common)
diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp
index 092001e224..68b84d0e1b 100644
--- a/src/common/logging/text_formatter.cpp
+++ b/src/common/logging/text_formatter.cpp
@@ -25,6 +25,8 @@ namespace Common::Log {
// Some IDEs prefer <file>:<line> instead, so let's just do that :)
std::string FormatLogMessage(const Entry& entry) {
+ if (!entry.filename) return "";
+
auto const time_seconds = uint32_t(entry.timestamp.count() / 1000000);
auto const time_fractional = uint32_t(entry.timestamp.count() % 1000000);
char const* class_name = GetLogClassName(entry.log_class);
diff --git a/src/yuzu_room_standalone/CMakeLists.txt b/src/yuzu_room_standalone/CMakeLists.txt
index f1db470495..125c7c911d 100644
--- a/src/yuzu_room_standalone/CMakeLists.txt
+++ b/src/yuzu_room_standalone/CMakeLists.txt
@@ -1,9 +1,7 @@
-# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
+# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
-add_executable(yuzu_room_standalone
- yuzu_room_standalone.cpp
-)
+add_executable(yuzu_room_standalone yuzu_room_standalone.cpp)
set_target_properties(yuzu_room_standalone PROPERTIES OUTPUT_NAME "eden-room")
@@ -13,4 +11,8 @@ if(UNIX AND NOT APPLE)
install(TARGETS yuzu_room_standalone RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
endif()
+if (YUZU_STATIC_ROOM)
+ target_link_options(yuzu_room_standalone PRIVATE "-static")
+endif()
+
create_target_directory_groups(yuzu_room_standalone)