remove solo executables (#106)

also, fixes CI not targeting the right flag settings.

this pr needs to add the room exe removal from lime3ds.

Signed-off-by: Aleksandr Popovich <alekpopo@pm.me>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/106
Co-authored-by: Aleksandr Popovich <alekpopo@pm.me>
Co-committed-by: Aleksandr Popovich <alekpopo@pm.me>
This commit is contained in:
Aleksandr Popovich 2025-05-19 21:30:10 +00:00 committed by AlekPop
parent bc55ed496f
commit 1f8b8e0fa1
13 changed files with 178 additions and 91 deletions

View file

@ -25,14 +25,13 @@ if [ -z "$NPROC" ]; then
fi fi
if [ "$TARGET" = "appimage" ]; then if [ "$TARGET" = "appimage" ]; then
# Compile the AppImage we distribute with Clang. export EXTRA_CMAKE_FLAGS=(-DYUZU_CMD=OFF -DYUZU_ROOM_STANDALONE=OFF)
export EXTRA_CMAKE_FLAGS=(-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_LINKER=/etc/bin/ld.lld)
# Bundle required QT wayland libraries # Bundle required QT wayland libraries
export EXTRA_QT_PLUGINS="waylandcompositor" export EXTRA_QT_PLUGINS="waylandcompositor"
export EXTRA_PLATFORM_PLUGINS="libqwayland-egl.so;libqwayland-generic.so" export EXTRA_PLATFORM_PLUGINS="libqwayland-egl.so;libqwayland-generic.so"
else else
# For the linux-fresh verification target, verify compilation without PCH as well. # For the linux-fresh verification target, verify compilation without PCH as well.
export EXTRA_CMAKE_FLAGS=(-DCITRA_USE_PRECOMPILED_HEADERS=OFF) export EXTRA_CMAKE_FLAGS=(-DYUZU_USE_PRECOMPILED_HEADERS=OFF)
fi fi
if [ "$GITHUB_REF_TYPE" == "tag" ]; then if [ "$GITHUB_REF_TYPE" == "tag" ]; then

View file

@ -96,7 +96,7 @@ jobs:
fetch-tags: true fetch-tags: true
- name: Build - name: Build
run: ./.ci/linux/build.sh v3 8 run: TARGET=appimage ./.ci/linux/build.sh v3 8
- name: Package AppImage - name: Package AppImage
run: ./.ci/linux/package.sh v3 &> /dev/null run: ./.ci/linux/package.sh v3 &> /dev/null

View file

@ -93,7 +93,7 @@ jobs:
fetch-tags: true fetch-tags: true
- name: Build - name: Build
run: ./.ci/linux/build.sh v3 8 run: TARGET=appimage ./.ci/linux/build.sh v3 8
- name: Package AppImage - name: Package AppImage
run: ./.ci/linux/package.sh v3 &> /dev/null run: ./.ci/linux/package.sh v3 &> /dev/null

View file

@ -61,7 +61,11 @@ option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON) option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON)
CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Compile LDN room server" ON "NOT ANDROID" OFF) CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Enable dedicated room functionality" ON "NOT ANDROID" OFF)
CMAKE_DEPENDENT_OPTION(YUZU_ROOM_STANDALONE "Enable standalone room executable" ON "YUZU_ROOM" OFF)
CMAKE_DEPENDENT_OPTION(YUZU_CMD "Compile the eden-cli executable" ON "NOT ANDROID" OFF)
CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF) CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF)
@ -285,6 +289,10 @@ if (ARCHITECTURE_arm64 AND (ANDROID OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
add_definitions(-DHAS_NCE=1) add_definitions(-DHAS_NCE=1)
endif() endif()
if (YUZU_ROOM)
add_definitions(-DYUZU_ROOM)
endif()
# Configure C++ standard # Configure C++ standard
# =========================== # ===========================
@ -396,7 +404,6 @@ endif()
add_subdirectory(externals) add_subdirectory(externals)
if (ENABLE_QT) if (ENABLE_QT)
if (NOT USE_SYSTEM_QT) if (NOT USE_SYSTEM_QT)
download_qt(6.8.3) download_qt(6.8.3)

View file

@ -201,11 +201,16 @@ if (YUZU_TESTS)
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()
if (ENABLE_SDL2) if (ENABLE_SDL2 AND YUZU_CMD)
add_subdirectory(yuzu_cmd) add_subdirectory(yuzu_cmd)
set_target_properties(yuzu-cmd PROPERTIES OUTPUT_NAME "eden-cli") set_target_properties(yuzu-cmd PROPERTIES OUTPUT_NAME "eden-cli")
endif() endif()
if (YUZU_ROOM_STANDALONE)
add_subdirectory(yuzu_room_standalone)
set_target_properties(yuzu-room PROPERTIES OUTPUT_NAME "eden-room")
endif()
if (ENABLE_QT) if (ENABLE_QT)
add_subdirectory(yuzu) add_subdirectory(yuzu)
endif() endif()

View file

@ -1,9 +1,13 @@
# SPDX-FileCopyrightText: 2017 Citra Emulator Project # SPDX-FileCopyrightText: 2017 Citra Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
add_executable(yuzu-room # SPDX-FileCopyrightText: 2025 eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
add_library(yuzu-room STATIC EXCLUDE_FROM_ALL
precompiled_headers.h precompiled_headers.h
yuzu_room.cpp yuzu_room.cpp
yuzu_room.h
yuzu_room.rc yuzu_room.rc
) )
@ -27,6 +31,4 @@ if (YUZU_USE_PRECOMPILED_HEADERS)
target_precompile_headers(yuzu-room PRIVATE precompiled_headers.h) target_precompile_headers(yuzu-room PRIVATE precompiled_headers.h)
endif() endif()
set_target_properties(yuzu-room PROPERTIES OUTPUT_NAME "eden-room")
create_target_directory_groups(yuzu-room) create_target_directory_groups(yuzu-room)

View file

@ -1,9 +1,11 @@
// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project // SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project / Eden Emulator Project // SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2025 eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <chrono> #include <chrono>
#include <fstream> #include <fstream>
@ -47,6 +49,8 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#include "yuzu_room.h"
static void PrintHelp(const char* argv0) { static void PrintHelp(const char* argv0) {
LOG_INFO(Network, LOG_INFO(Network,
"Usage: {}" "Usage: {}"
@ -186,11 +190,17 @@ static void InitializeLogging(const std::string& log_file) {
} }
/// Application entry point /// Application entry point
int main(int argc, char** argv) { void LaunchRoom(int argc, char** argv, bool called_by_option)
{
Common::DetachedTasks detached_tasks; Common::DetachedTasks detached_tasks;
int option_index = 0; int option_index = 0;
char* endarg; char* endarg;
char* new_argv0 = argv[0];
if (called_by_option) {
strncat(new_argv0, " --room", 8);
}
std::string room_name; std::string room_name;
std::string room_description; std::string room_description;
std::string password; std::string password;
@ -205,6 +215,7 @@ int main(int argc, char** argv) {
u32 port = Network::DefaultRoomPort; u32 port = Network::DefaultRoomPort;
u32 max_members = 16; u32 max_members = 16;
// TODO(alekpop): Implement this into main executable, for --room and a few others.
static struct option long_options[] = { static struct option long_options[] = {
{"room-name", required_argument, 0, 'n'}, {"room-name", required_argument, 0, 'n'},
{"room-description", required_argument, 0, 'd'}, {"room-description", required_argument, 0, 'd'},
@ -222,14 +233,15 @@ int main(int argc, char** argv) {
{"enable-yuzu-mods", no_argument, 0, 'e'}, {"enable-yuzu-mods", no_argument, 0, 'e'},
{"help", no_argument, 0, 'h'}, {"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'v'}, {"version", no_argument, 0, 'v'},
// Entry option
{"room", 0, 0, 0},
{0, 0, 0, 0}, {0, 0, 0, 0},
}; };
InitializeLogging(log_file); InitializeLogging(log_file);
while (optind < argc) { while (optind < argc) {
int arg = int arg = getopt_long(argc, argv, "n:d:s:p:m:w:g:u:t:a:i:l:hv", long_options, &option_index);
getopt_long(argc, argv, "n:d:s:p:m:w:g:u:t:a:i:l:hv", long_options, &option_index);
if (arg != -1) { if (arg != -1) {
switch (static_cast<char>(arg)) { switch (static_cast<char>(arg)) {
case 'n': case 'n':
@ -273,10 +285,10 @@ int main(int argc, char** argv) {
break; break;
case 'h': case 'h':
PrintHelp(argv[0]); PrintHelp(argv[0]);
return 0; std::exit(0);
case 'v': case 'v':
PrintVersion(); PrintVersion();
return 0; std::exit(0);
} }
} }
} }
@ -284,12 +296,12 @@ int main(int argc, char** argv) {
if (room_name.empty()) { if (room_name.empty()) {
LOG_ERROR(Network, "Room name is empty!"); LOG_ERROR(Network, "Room name is empty!");
PrintHelp(argv[0]); PrintHelp(argv[0]);
return -1; std::exit(-1);
} }
if (preferred_game.empty()) { if (preferred_game.empty()) {
LOG_ERROR(Network, "Preferred game is empty!"); LOG_ERROR(Network, "Preferred game is empty!");
PrintHelp(argv[0]); PrintHelp(argv[0]);
return -1; std::exit(-1);
} }
if (preferred_game_id == 0) { if (preferred_game_id == 0) {
LOG_ERROR(Network, LOG_ERROR(Network,
@ -297,10 +309,11 @@ int main(int argc, char** argv) {
"room.\nSet with --preferred-game-id id"); "room.\nSet with --preferred-game-id id");
} }
if (max_members > Network::MaxConcurrentConnections || max_members < 2) { if (max_members > Network::MaxConcurrentConnections || max_members < 2) {
LOG_ERROR(Network, "max_members needs to be in the range 2 - {}!", LOG_ERROR(Network,
"max_members needs to be in the range 2 - {}!",
Network::MaxConcurrentConnections); Network::MaxConcurrentConnections);
PrintHelp(argv[0]); PrintHelp(argv[0]);
return -1; std::exit(-1);
} }
if (bind_address.empty()) { if (bind_address.empty()) {
LOG_INFO(Network, "Bind address is empty: defaulting to 0.0.0.0"); LOG_INFO(Network, "Bind address is empty: defaulting to 0.0.0.0");
@ -308,10 +321,11 @@ int main(int argc, char** argv) {
if (port > UINT16_MAX) { if (port > UINT16_MAX) {
LOG_ERROR(Network, "Port needs to be in the range 0 - 65535!"); LOG_ERROR(Network, "Port needs to be in the range 0 - 65535!");
PrintHelp(argv[0]); PrintHelp(argv[0]);
return -1; std::exit(-1);
} }
if (ban_list_file.empty()) { if (ban_list_file.empty()) {
LOG_ERROR(Network, "Ban list file not set!\nThis should get set to load and save room ban " LOG_ERROR(Network,
"Ban list file not set!\nThis should get set to load and save room ban "
"list.\nSet with --ban-list-file <file>"); "list.\nSet with --ban-list-file <file>");
} }
bool announce = true; bool announce = true;
@ -368,7 +382,7 @@ int main(int argc, char** argv) {
password, max_members, username, preferred_game_info, password, max_members, username, preferred_game_info,
std::move(verify_backend), ban_list)) { std::move(verify_backend), ban_list)) {
LOG_INFO(Network, "Failed to create room: "); LOG_INFO(Network, "Failed to create room: ");
return -1; std::exit(-1);
} }
LOG_INFO(Network, "Room is open. Close with Q+Enter..."); LOG_INFO(Network, "Room is open. Close with Q+Enter...");
auto announce_session = std::make_unique<Core::AnnounceMultiplayerSession>(network); auto announce_session = std::make_unique<Core::AnnounceMultiplayerSession>(network);
@ -395,5 +409,5 @@ int main(int argc, char** argv) {
} }
network.Shutdown(); network.Shutdown();
detached_tasks.WaitForAllTasks(); detached_tasks.WaitForAllTasks();
return 0; std::exit(0);
} }

View file

@ -0,0 +1,7 @@
// Copyright eden Emulator Project
// Licensed under GPLv3 or any later version
// Refer to the license.txt file included.
#pragma once
void LaunchRoom(int argc, char** argv, bool called_by_option);

View file

@ -484,4 +484,8 @@ if (YUZU_USE_PRECOMPILED_HEADERS)
target_precompile_headers(yuzu PRIVATE precompiled_headers.h) target_precompile_headers(yuzu PRIVATE precompiled_headers.h)
endif() endif()
if (YUZU_ROOM)
target_link_libraries(yuzu PRIVATE yuzu-room)
endif()
create_target_directory_groups(yuzu) create_target_directory_groups(yuzu)

View file

@ -52,6 +52,10 @@
#include "yuzu/multiplayer/state.h" #include "yuzu/multiplayer/state.h"
#include "yuzu/util/controller_navigation.h" #include "yuzu/util/controller_navigation.h"
#ifdef YUZU_ROOM
#include "dedicated_room/yuzu_room.h"
#endif
// These are wrappers to avoid the calls to CreateDirectory and CreateFile because of the Windows // These are wrappers to avoid the calls to CreateDirectory and CreateFile because of the Windows
// defines. // defines.
static FileSys::VirtualDir VfsFilesystemCreateDirectoryWrapper( static FileSys::VirtualDir VfsFilesystemCreateDirectoryWrapper(
@ -5457,6 +5461,20 @@ static void SetHighDPIAttributes() {
} }
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
#if YUZU_ROOM
bool launch_room = false;
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--room") == 0) {
launch_room = true;
}
}
if (launch_room) {
LaunchRoom(argc, argv, true);
return 0;
}
#endif
bool has_broken_vulkan = false; bool has_broken_vulkan = false;
bool is_child = false; bool is_child = false;
if (CheckEnvVars(&is_child)) { if (CheckEnvVars(&is_child)) {
@ -5521,6 +5539,7 @@ int main(int argc, char* argv[]) {
QApplication app(argc, argv); QApplication app(argc, argv);
#ifdef _WIN32 #ifdef _WIN32
OverrideWindowsFont(); OverrideWindowsFont();
#endif #endif

View file

@ -0,0 +1,11 @@
add_executable(yuzu_room_standalone
yuzu_room_standalone.cpp
)
set_target_properties(yuzu_room_standalone PROPERTIES OUTPUT_NAME "eden-room")
target_link_libraries(yuzu_room_standalone PRIVATE yuzu-room)
if(UNIX AND NOT APPLE)
install(TARGETS yuzu_room_standalone RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
endif()

View file

@ -0,0 +1,9 @@
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}

View file

@ -0,0 +1,10 @@
// Copyright eden Emulator Project
// Licensed under GPLv3 or any later version
// Refer to the license.txt file included.
#include "dedicated_room/yuzu_room.h"
int main(int argc, char* argv[])
{
LaunchRoom(argc, argv, false);
}