From 0bf275da3fa549e872dc92199df0472b5945283b Mon Sep 17 00:00:00 2001 From: quic_yaommo Date: Wed, 20 Dec 2023 14:53:27 +0800 Subject: [PATCH] xrt: Set runtime descriptions from CMake --- CMakeLists.txt | 1 + src/xrt/auxiliary/util/u_git_tag.c.in | 2 ++ src/xrt/auxiliary/util/u_git_tag.h | 1 + src/xrt/ipc/server/ipc_server_process.c | 2 +- src/xrt/state_trackers/oxr/oxr_instance.c | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7aeb75b05..a653aaa16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ project( XRT VERSION 21.0.0 LANGUAGES C CXX + DESCRIPTION "Monado(XRT) by Collabora et al" ) # CMake 3.11 introduced CMP0072 - Prefer GLVND diff --git a/src/xrt/auxiliary/util/u_git_tag.c.in b/src/xrt/auxiliary/util/u_git_tag.c.in index 4dc08adb1..d80ff8ae5 100644 --- a/src/xrt/auxiliary/util/u_git_tag.c.in +++ b/src/xrt/auxiliary/util/u_git_tag.c.in @@ -14,8 +14,10 @@ #define MAJOR_VERSION @CMAKE_PROJECT_VERSION_MAJOR@ #define MINOR_VERSION @CMAKE_PROJECT_VERSION_MINOR@ #define PATCH_VERSION @CMAKE_PROJECT_VERSION_PATCH@ +#define RUNTIME_DESCRIPTION "@CMAKE_PROJECT_DESCRIPTION@" const char u_git_tag[] = GIT_DESC; const uint16_t u_version_major = MAJOR_VERSION; const uint16_t u_version_minor = MINOR_VERSION; const uint16_t u_version_patch = PATCH_VERSION; +const char u_runtime_description[] = RUNTIME_DESCRIPTION; \ No newline at end of file diff --git a/src/xrt/auxiliary/util/u_git_tag.h b/src/xrt/auxiliary/util/u_git_tag.h index 744c55320..6578f0a65 100644 --- a/src/xrt/auxiliary/util/u_git_tag.h +++ b/src/xrt/auxiliary/util/u_git_tag.h @@ -20,6 +20,7 @@ extern const char u_git_tag[]; extern const uint16_t u_version_major; extern const uint16_t u_version_minor; extern const uint16_t u_version_patch; +extern const char u_runtime_description[]; #ifdef __cplusplus diff --git a/src/xrt/ipc/server/ipc_server_process.c b/src/xrt/ipc/server/ipc_server_process.c index cf12152e0..bac85302a 100644 --- a/src/xrt/ipc/server/ipc_server_process.c +++ b/src/xrt/ipc/server/ipc_server_process.c @@ -899,7 +899,7 @@ ipc_server_main(int argc, char **argv) { struct ipc_server *s = U_TYPED_CALLOC(struct ipc_server); - U_LOG_I("Monado Service %s starting up...", u_git_tag); + U_LOG_I("%s '%s' starting up...", u_runtime_description, u_git_tag); // need to create early before any vars are added u_debug_gui_create(&s->debug_gui); diff --git a/src/xrt/state_trackers/oxr/oxr_instance.c b/src/xrt/state_trackers/oxr/oxr_instance.c index 977731fb7..8502a922a 100644 --- a/src/xrt/state_trackers/oxr/oxr_instance.c +++ b/src/xrt/state_trackers/oxr/oxr_instance.c @@ -445,7 +445,7 @@ XrResult oxr_instance_get_properties(struct oxr_logger *log, struct oxr_instance *inst, XrInstanceProperties *instanceProperties) { instanceProperties->runtimeVersion = XR_MAKE_VERSION(u_version_major, u_version_minor, u_version_patch); - snprintf(instanceProperties->runtimeName, XR_MAX_RUNTIME_NAME_SIZE - 1, "Monado(XRT) by Collabora et al '%s'", + snprintf(instanceProperties->runtimeName, XR_MAX_RUNTIME_NAME_SIZE - 1, "%s '%s'", u_runtime_description, u_git_tag); return XR_SUCCESS;