public: split VCS info to separate file for slightly better compilation speeds
This commit is contained in:
parent
69341e36a3
commit
201d9c8f80
3 changed files with 26 additions and 7 deletions
|
@ -239,6 +239,3 @@ const char *Q_buildarch( void )
|
|||
);
|
||||
}
|
||||
|
||||
const char *g_buildcommit = XASH_BUILD_COMMIT;
|
||||
const char *g_buildbranch = XASH_BUILD_BRANCH;
|
||||
|
||||
|
|
18
public/build_vcs.c
Normal file
18
public/build_vcs.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
build_vcs.c - info from VCS
|
||||
Copyright (C) 2025 Alibek Omarov
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
const char *g_buildcommit = XASH_BUILD_COMMIT;
|
||||
const char *g_buildbranch = XASH_BUILD_BRANCH;
|
||||
|
|
@ -118,10 +118,14 @@ def build(bld):
|
|||
export_includes = '. ../common ../pm_shared ../engine',
|
||||
export_defines = bld.env.EXPORT_DEFINES_LIST)
|
||||
|
||||
bld.stlib(source = bld.path.ant_glob('*.c'),
|
||||
target = 'public',
|
||||
use = 'sdk_includes werror',
|
||||
defines = ['XASH_BUILD_COMMIT=\"%s\"' % bld.env.GIT_VERSION, 'XASH_BUILD_BRANCH=\"%s\"' % bld.env.GIT_BRANCH])
|
||||
# build it separately to slightly improve rebuild times
|
||||
bld.stlib(source = 'build_vcs.c',
|
||||
target = 'build_vcs',
|
||||
defines = ['XASH_BUILD_COMMIT=\"%s\"' % bld.env.GIT_VERSION, 'XASH_BUILD_BRANCH=\"%s\"' % bld.env.GIT_BRANCH])
|
||||
|
||||
bld.stlib(source = bld.path.ant_glob('*.c', excl='build_vcs.c'),
|
||||
target = 'public',
|
||||
use = 'sdk_includes werror build_vcs')
|
||||
|
||||
if bld.env.TESTS:
|
||||
if bld.env.VALIDATE_TARGET:
|
||||
|
|
Loading…
Add table
Reference in a new issue