Rewrite child application management

Forked applications are managed by a class, which can track more than
one child.
Systemd mode uses transient units, libsystemd is replaced by
gdbus-codegen, the management objects shares the interface with forked
application.
This commit is contained in:
Patrick Nicolas
2025-07-22 20:49:32 +02:00
parent 2f5496c06e
commit d3e10dc31b
8 changed files with 1759 additions and 363 deletions
+16
View File
@@ -188,6 +188,22 @@ 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()
target_link_libraries(
wivrn-server
PRIVATE