xrt: Set runtime descriptions from CMake

This commit is contained in:
quic_yaommo 2023-12-20 14:53:27 +08:00 committed by Jakob Bornecrantz
parent 5b573b0ad5
commit 0bf275da3f
5 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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);

View file

@ -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;