st/oxr: Don't use the debug gui by default in out-of-process

This commit is contained in:
Moses Turner 2022-07-11 18:35:24 +01:00 committed by Moses Turner
parent f55ac05578
commit fa2554f289
4 changed files with 24 additions and 1 deletions

View file

@ -245,6 +245,16 @@ option_with_deps(XRT_FEATURE_SLAM "Enable SLAM tracking support" DEPENDS XRT_HAV
option_with_deps(XRT_FEATURE_STEAMVR_PLUGIN "Build SteamVR plugin" DEPENDS "NOT ANDROID")
option_with_deps(XRT_FEATURE_TRACING "Enable debug tracing on supported platforms" DEFAULT OFF DEPENDS XRT_HAVE_PERCETTO)
if (XRT_FEATURE_SERVICE)
# Disable the client debug gui by default for out-of-proc -
# too many clients have problems with depending on SDL/GStreamer/etc and we rarely use it in this configuration
option(XRT_FEATURE_CLIENT_DEBUG_GUI "Allow clients to have their own instances of the debug gui" OFF)
else()
# Enable the client debug gui by default for in-proc -
# In in-proc, the client debug gui is the same as the server debug gui, and we use it a lot in this configuration
option(XRT_FEATURE_CLIENT_DEBUG_GUI "Allow clients to have their own instances of the debug gui" ON)
endif()
# systemd detailed config
option_with_deps(XRT_INSTALL_SYSTEMD_UNIT_FILES "Install user unit files for systemd socket activation on installation" DEPENDS XRT_HAVE_SYSTEMD)
option_with_deps(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES "Use an absolute path to monado-system in installed user unit files for systemd socket activation" DEPENDS XRT_HAVE_SYSTEMD)
@ -475,6 +485,7 @@ message(STATUS "# FEATURE_RENDERDOC: ${XRT_FEATURE_RENDERD
message(STATUS "# FEATURE_SERVICE: ${XRT_FEATURE_SERVICE}")
message(STATUS "# FEATURE_STEAMVR_PLUGIN: ${XRT_FEATURE_STEAMVR_PLUGIN}")
message(STATUS "# FEATURE_TRACING: ${XRT_FEATURE_TRACING}")
message(STATUS "# FEATURE_CLIENT_DEBUG_GUI: ${XRT_FEATURE_CLIENT_DEBUG_GUI}")
message(STATUS "#")
message(STATUS "# DRIVER_ANDROID: ${XRT_BUILD_DRIVER_ANDROID}")
message(STATUS "# DRIVER_ARDUINO: ${XRT_BUILD_DRIVER_ARDUINO}")

View file

@ -26,3 +26,4 @@
#cmakedefine XRT_FEATURE_SERVICE
#cmakedefine XRT_FEATURE_SLAM
#cmakedefine XRT_FEATURE_TRACING
#cmakedefine XRT_FEATURE_CLIENT_DEBUG_GUI

View file

@ -48,6 +48,7 @@ DEBUG_GET_ONCE_FLOAT_OPTION(tracking_origin_offset_x, "OXR_TRACKING_ORIGIN_OFFSE
DEBUG_GET_ONCE_FLOAT_OPTION(tracking_origin_offset_y, "OXR_TRACKING_ORIGIN_OFFSET_Y", 0.0f)
DEBUG_GET_ONCE_FLOAT_OPTION(tracking_origin_offset_z, "OXR_TRACKING_ORIGIN_OFFSET_Z", 0.0f)
#ifdef XRT_FEATURE_CLIENT_DEBUG_GUI
/* ---- HACK ---- */
extern int
oxr_sdl2_hack_create(void **out_hack);
@ -58,6 +59,7 @@ oxr_sdl2_hack_start(void *hack, struct xrt_instance *xinst, struct xrt_system_de
extern void
oxr_sdl2_hack_stop(void **hack_ptr);
/* ---- HACK ---- */
#endif
static XrResult
oxr_instance_destroy(struct oxr_logger *log, struct oxr_handle_base *hb)
@ -78,9 +80,11 @@ oxr_instance_destroy(struct oxr_logger *log, struct oxr_handle_base *hb)
xrt_system_devices_destroy(&inst->system.xsysd);
#ifdef XRT_FEATURE_CLIENT_DEBUG_GUI
/* ---- HACK ---- */
oxr_sdl2_hack_stop(&inst->hack);
/* ---- HACK ---- */
#endif
xrt_instance_destroy(&inst->xinst);
@ -189,9 +193,11 @@ oxr_instance_create(struct oxr_logger *log,
return ret;
}
#ifdef XRT_FEATURE_CLIENT_DEBUG_GUI
/* ---- HACK ---- */
oxr_sdl2_hack_create(&inst->hack);
/* ---- HACK ---- */
#endif
ret = oxr_path_init(log, inst);
if (ret != XR_SUCCESS) {
@ -323,9 +329,11 @@ oxr_instance_create(struct oxr_logger *log,
u_var_add_root((void *)inst, "XrInstance", true);
#ifdef XRT_FEATURE_CLIENT_DEBUG_GUI
/* ---- HACK ---- */
oxr_sdl2_hack_start(inst->hack, inst->xinst, sys->xsysd);
/* ---- HACK ---- */
#endif
oxr_log(log,
"Instance created\n"

View file

@ -145,4 +145,7 @@ if(XRT_HAVE_SDL2)
target_link_libraries(oxr_sdl2 PRIVATE drv_qwerty drv_qwerty_includes)
endif()
endif()
target_link_libraries(${RUNTIME_TARGET} PRIVATE oxr_sdl2)
if(XRT_FEATURE_CLIENT_DEBUG_GUI)
target_link_libraries(${RUNTIME_TARGET} PRIVATE oxr_sdl2)
endif()