public: build: use XASH_BUILD_BRANCH define set by Waf. Expect XASH_BUILD_{BRANCH,COMMIT} to be always set.

This commit is contained in:
Alibek Omarov 2024-03-19 19:34:30 +03:00
parent 0506a1dfce
commit 6fa4dbfba2
1 changed files with 4 additions and 11 deletions

View File

@ -237,32 +237,25 @@ const char *Q_buildarch( void )
=============
Q_buildcommit
Returns a short hash of current commit in VCS as string.
Returns a short hash of current commit in VCS as string
XASH_BUILD_COMMIT must be passed in quotes
if XASH_BUILD_COMMIT is not defined,
Q_buildcommit will identify this build as "notset"
=============
*/
const char *Q_buildcommit( void )
{
#ifdef XASH_BUILD_COMMIT
return XASH_BUILD_COMMIT;
#else
return "notset";
#endif
}
/*
=============
Q_buildbranch
Returns current branch name in VCS as string. For now it's just a stub.
P.S: I don't know how to implement it from waf side, so a1ba, please do it :)
Returns current branch name in VCS as string
XASH_BUILD_BRANCH must be passed in quotes
=============
*/
const char *Q_buildbranch( void )
{
return "branch";
return XASH_BUILD_BRANCH;
}