diff --git a/public/build.c b/public/build.c index 445416d1..237fd0ee 100644 --- a/public/build.c +++ b/public/build.c @@ -239,6 +239,3 @@ const char *Q_buildarch( void ) ); } -const char *g_buildcommit = XASH_BUILD_COMMIT; -const char *g_buildbranch = XASH_BUILD_BRANCH; - diff --git a/public/build_vcs.c b/public/build_vcs.c new file mode 100644 index 00000000..89a55d8e --- /dev/null +++ b/public/build_vcs.c @@ -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; + diff --git a/public/wscript b/public/wscript index f453f34b..3cfac7a9 100644 --- a/public/wscript +++ b/public/wscript @@ -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: