From 5ff7062a262a0fc272108fd734e367b273ae600d Mon Sep 17 00:00:00 2001 From: Rylie Pavlik Date: Tue, 28 Jan 2025 12:25:09 -0600 Subject: [PATCH] build: Introduce XRT_FEATURE_CLIENT_WITHOUT_SERVICE and XRT_FEATURE_IPC_CLIENT Part-of: --- CMakeLists.txt | 12 ++++++++++++ src/xrt/include/xrt/xrt_config_build.h.cmake_in | 2 ++ 2 files changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 665104b01..2162f9a2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -286,6 +286,18 @@ 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_with_deps(XRT_FEATURE_CLIENT_DEBUG_GUI "Allow clients to have their own instances of the debug gui" DEFAULT ON DEPENDS XRT_FEATURE_DEBUG_GUI) + + # This is an advanced feature, for if you want the client module without the service. + # Typically only used in derived runtimes or to build the client and service with different build options + # (such as Android C++ standard library) that do not affect the IPC ABI. + option_with_deps(XRT_FEATURE_CLIENT_WITHOUT_SERVICE "Enable building OpenXR runtime as IPC client without simultaneously building the service" DEFAULT OFF DEPENDS XRT_MODULE_IPC XRT_FEATURE_OPENXR "NOT XRT_FEATURE_SERVICE") +endif() + +# Do not manually set XRT_FEATURE_IPC_CLIENT, it is always computed +if(XRT_FEATURE_SERVICE OR XRT_FEATURE_CLIENT_WITHOUT_SERVICE) + set(XRT_FEATURE_IPC_CLIENT ON) +else() + set(XRT_FEATURE_IPC_CLIENT OFF) endif() # systemd detailed config diff --git a/src/xrt/include/xrt/xrt_config_build.h.cmake_in b/src/xrt/include/xrt/xrt_config_build.h.cmake_in index ab14c1aa9..9b1255e89 100644 --- a/src/xrt/include/xrt/xrt_config_build.h.cmake_in +++ b/src/xrt/include/xrt/xrt_config_build.h.cmake_in @@ -26,8 +26,10 @@ /* keep sorted */ #cmakedefine XRT_FEATURE_CLIENT_DEBUG_GUI +#cmakedefine XRT_FEATURE_CLIENT_WITHOUT_SERVICE #cmakedefine XRT_FEATURE_COLOR_LOG #cmakedefine XRT_FEATURE_DEBUG_GUI +#cmakedefine XRT_FEATURE_IPC_CLIENT #cmakedefine XRT_FEATURE_OPENXR #cmakedefine XRT_FEATURE_OPENXR_ACTIVE_ACTION_SET_PRIORITY #cmakedefine XRT_FEATURE_OPENXR_BODY_TRACKING_FB -- 2.51.2