Remove WIVRN_USE_SYSTEMD config option

This commit is contained in:
Patrick Nicolas
2026-08-06 19:33:22 +02:00
parent ca59f46751
commit 85a635069f
4 changed files with 32 additions and 37 deletions
-8
View File
@@ -35,7 +35,6 @@ option(WIVRN_USE_SYSTEM_FREETYPE "Use system FreeType" ON)
option(WIVRN_USE_SYSTEM_BOOST "Use system Boost headers" ON)
option(WIVRN_USE_SYSTEM_OPENXR "Use system OpenXR headers" ON)
option(WIVRN_USE_SYSTEM_LIBKTX "Use system KTX-Software library" ON)
option(WIVRN_USE_SYSTEMD "Use libsystemd" ON)
option(WIVRN_COMPRESS_GLB "Compress textures in GLB files with gltf-transform" OFF)
option(WIVRN_USE_ANDROID_VALIDATION_LAYER "Download the android version of the Vulkan validation layer" OFF)
option(WIVRN_USE_ANDROID_BIN_LIBKTX "Download the prebuilt libktx for android" OFF)
@@ -140,10 +139,6 @@ if (WIVRN_BUILD_SERVER)
pkg_check_modules(X264 REQUIRED IMPORTED_TARGET x264)
endif()
if (WIVRN_USE_SYSTEMD)
pkg_check_modules(SYSTEMD REQUIRED IMPORTED_TARGET libsystemd)
endif()
if (WIVRN_USE_PIPEWIRE)
pkg_check_modules(libpipewire REQUIRED IMPORTED_TARGET libpipewire-0.3)
endif()
@@ -318,9 +313,6 @@ if (WIVRN_BUILD_SERVER OR WIVRN_BUILD_SERVER_LIBRARY)
message(STATUS "")
message(STATUS "Audio backends:")
message(STATUS "\tPipewire : ${WIVRN_USE_PIPEWIRE}")
message(STATUS "")
message(STATUS "Optional features:")
message(STATUS "\tsystemd: ${WIVRN_USE_SYSTEMD}")
endif()
endif()
-2
View File
@@ -33,8 +33,6 @@ static const int64_t max_extrapolation_ns = 80'000'000;
#cmakedefine01 WIVRN_USE_VULKAN_ENCODE
#cmakedefine01 WIVRN_USE_X264
#cmakedefine01 WIVRN_USE_SYSTEMD
#cmakedefine01 WIVRN_USE_PIPEWIRE
#cmakedefine01 WIVRN_FEATURE_DEBUG_GUI
+11 -20
View File
@@ -62,7 +62,7 @@ set(XRT_HAVE_DBUS OFF)
set(XRT_HAVE_LIBUDEV OFF)
set(XRT_HAVE_ONNXRUNTIME OFF)
set(XRT_HAVE_SYSTEMD ${WIVRN_USE_SYSTEMD})
set(XRT_HAVE_SYSTEMD OFF)
set(XRT_INSTALL_SYSTEMD_UNIT_FILES OFF)
set(BUILD_DOC OFF)
@@ -97,6 +97,7 @@ if (WIVRN_BUILD_SERVER)
main.cpp
sleep_inhibitor.cpp
start_application.cpp
start_systemd_unit.cpp
ipc_server_cb.cpp
target_instance_wivrn.cpp
wivrn_ipc.cpp
@@ -206,10 +207,6 @@ if (WIVRN_BUILD_SERVER)
endif()
endif()
if(WIVRN_USE_SYSTEMD)
target_link_libraries(wivrn-server PRIVATE PkgConfig::SYSTEMD)
endif()
if(WIVRN_USE_PIPEWIRE)
target_sources(
wivrn-server
@@ -233,21 +230,15 @@ if (WIVRN_BUILD_SERVER)
target_link_libraries(wivrn-server PUBLIC wivrn-server-dbus)
target_link_libraries(wivrn-server PUBLIC PkgConfig::libnotify)
if(WIVRN_USE_SYSTEMD)
add_custom_command(OUTPUT systemd_manager.c systemd_manager.h
COMMAND ${GDBUS_CODEGEN} ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml --interface-prefix org.freedesktop.systemd1 --generate-c-code systemd_manager --c-namespace systemd
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml )
add_custom_command(OUTPUT systemd_unit.c systemd_unit.h
COMMAND ${GDBUS_CODEGEN} ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Unit.xml --interface-prefix org.freedesktop.systemd1 --generate-c-code systemd_unit --c-namespace unit
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml )
target_sources(wivrn-server-dbus PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/systemd_manager.c ${CMAKE_CURRENT_BINARY_DIR}/systemd_manager.h
${CMAKE_CURRENT_BINARY_DIR}/systemd_unit.c ${CMAKE_CURRENT_BINARY_DIR}/systemd_unit.h)
target_sources(
wivrn-server
PRIVATE start_systemd_unit.cpp
)
endif()
add_custom_command(OUTPUT systemd_manager.c systemd_manager.h
COMMAND ${GDBUS_CODEGEN} ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml --interface-prefix org.freedesktop.systemd1 --generate-c-code systemd_manager --c-namespace systemd
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml )
add_custom_command(OUTPUT systemd_unit.c systemd_unit.h
COMMAND ${GDBUS_CODEGEN} ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Unit.xml --interface-prefix org.freedesktop.systemd1 --generate-c-code systemd_unit --c-namespace unit
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml )
target_sources(wivrn-server-dbus PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/systemd_manager.c ${CMAKE_CURRENT_BINARY_DIR}/systemd_manager.h
${CMAKE_CURRENT_BINARY_DIR}/systemd_unit.c ${CMAKE_CURRENT_BINARY_DIR}/systemd_unit.h)
target_link_libraries(
wivrn-server
+21 -7
View File
@@ -1,3 +1,23 @@
/*
* WiVRn VR streaming
* Copyright (C) 2022-2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2022-2026 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// Original copyright, from very old copy-pasted parts
// Copyright 2022, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
@@ -9,7 +29,6 @@
#include "openxr/openxr.h"
#include "sleep_inhibitor.h"
#include "util/u_trace_marker.h"
#include "utils/wivrn_trace.h"
#include "active_runtime.h"
#include "avahi_publisher.h"
@@ -19,6 +38,7 @@
#include "ipc_server_cb.h"
#include "protocol_version.h"
#include "start_application.h"
#include "start_systemd_unit.h"
#include "utils/overloaded.h"
#include "version.h"
#include "wivrn_config.h"
@@ -53,10 +73,6 @@
#include <shared/ipc_protocol.h>
#include <util/u_file.h>
#if WIVRN_USE_SYSTEMD
#include "start_systemd_unit.h"
#endif
// Insert the on load constructor to init trace marker.
U_TRACE_TARGET_SETUP(U_TRACE_WHICH_SERVICE)
@@ -819,13 +835,11 @@ void on_headset_info_packet(const wivrn::from_headset::headset_info_packet & inf
void on_name_acquired(GDBusConnection * connection, const gchar * name, gpointer user_data)
{
#if WIVRN_USE_SYSTEMD
try
{
children = std::make_unique<systemd_units_manager>(connection, update_fsm);
}
catch (...)
#endif
{
children = std::make_unique<forked_children>(update_fsm);
}