ipc: make the pid filename, the socket filename, and the client library suffix customizable

This commit is contained in:
Guillaume Meunier 2022-11-13 14:32:35 +01:00 committed by Jakob Bornecrantz
parent 86e31f54f3
commit 76dff0b42f
5 changed files with 9 additions and 5 deletions

View file

@ -311,6 +311,8 @@ option(XRT_BUILD_DRIVER_SIMULATED "Enable simulated driver" ON)
option(XRT_BUILD_SAMPLES "Enable compiling sample code implementations that will not be linked into any final targets" ON)
set(XRT_IPC_MSG_SOCK_FILENAME monado_comp_ipc CACHE STRING "Service socket filename")
set(XRT_IPC_SERVICE_PID_FILENAME monado.pid CACHE STRING "Service pidfile filename")
set(XRT_OXR_RUNTIME_SUFFIX monado CACHE STRING "OpenXR client library suffix")
# cmake-format: on

View file

@ -0,0 +1,3 @@
Add `XRT_IPC_SERVICE_PID_FILE_NAME` cmake variable to configure the name of pid file.
Add `XRT_OXR_RUNTIME_SUFFIX` cmake variable to configure the suffix of the output openXR library.

View file

@ -9,11 +9,10 @@
*/
#include "xrt/xrt_config.h"
#include "xrt/xrt_config_build.h"
#ifdef XRT_OS_LINUX
#define PID_FILE_NAME "monado.pid"
#ifdef XRT_HAVE_LIBBSD
#include <bsd/libutil.h>
#endif
@ -28,7 +27,7 @@
XRT_MAYBE_UNUSED static inline int
get_pidfile_path(char *buf)
{
int size = u_file_get_path_in_runtime_dir(PID_FILE_NAME, buf, PATH_MAX);
int size = u_file_get_path_in_runtime_dir(XRT_IPC_SERVICE_PID_FILENAME, buf, PATH_MAX);
if (size == -1) {
U_LOG_W("Failed to determine runtime dir, not creating pidfile");
return -1;

View file

@ -29,3 +29,4 @@
#cmakedefine XRT_FEATURE_CLIENT_DEBUG_GUI
#cmakedefine XRT_FEATURE_WINDOW_PEEK
#cmakedefine XRT_IPC_MSG_SOCK_FILENAME "@XRT_IPC_MSG_SOCK_FILENAME@"
#cmakedefine XRT_IPC_SERVICE_PID_FILENAME "@XRT_IPC_SERVICE_PID_FILENAME@"

View file

@ -4,8 +4,7 @@
######
# Create a loadable OpenXR driver.
set(RUNTIME_BARE_SUFFIX monado)
set(RUNTIME_SUFFIX _${RUNTIME_BARE_SUFFIX})
set(RUNTIME_SUFFIX _${XRT_OXR_RUNTIME_SUFFIX})
set(RUNTIME_TARGET
${RUNTIME_PREFIX}openxr${RUNTIME_SUFFIX}