From 73590dd0a37a6a864074d43d9d78b3afc27e238c Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 5 Apr 2024 19:47:53 +0300 Subject: [PATCH] server: include vcs info to the build and register variables --- dlls/CMakeLists.txt | 1 + dlls/game.cpp | 7 +++++++ dlls/wscript | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index b78706c5..cdfe02bd 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -148,6 +148,7 @@ set (SVDLL_SOURCES ../pm_shared/pm_debug.c ../pm_shared/pm_math.c ../pm_shared/pm_shared.c + ../game_shared/vcs_info.cpp ) include_directories (. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public) diff --git a/dlls/game.cpp b/dlls/game.cpp index a8011a37..140728fb 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -16,6 +16,10 @@ #include "eiface.h" #include "util.h" #include "game.h" +#include "vcs_info.h" + +static cvar_t build_commit = { "sv_game_build_commit", g_VCSInfo_Commit }; +static cvar_t build_branch = { "sv_game_build_branch", g_VCSInfo_Commit }; cvar_t displaysoundlist = {"displaysoundlist","0"}; @@ -470,6 +474,9 @@ void GameDLLInit( void ) g_enable_cheats = CVAR_GET_POINTER( "sv_cheats" ); + CVAR_REGISTER( &build_commit ); + CVAR_REGISTER( &build_branch ); + CVAR_REGISTER( &displaysoundlist ); CVAR_REGISTER( &allow_spectators ); diff --git a/dlls/wscript b/dlls/wscript index 00781777..82d9e870 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -24,10 +24,11 @@ def build(bld): source = bld.path.ant_glob('**/*.cpp', excl=excluded_files) source += bld.path.parent.ant_glob('pm_shared/*.c') + source += ['../game_shared/vcs_info.cpp'] defines = [] if bld.env.USE_VOICEMGR: - source += bld.path.parent.ant_glob('game_shared/voice_gamemgr.cpp') + source += ['../game_shared/voice_gamemgr.cpp'] else: defines += ['NO_VOICEGAMEMGR']