Print git version hash if available

This commit is contained in:
Ivailo Spasov
2013-01-21 15:54:05 +02:00
committed by Ivaylo Spasov
parent 934b59b480
commit 2b9ddf260d
2 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,8 @@
# (C)2004-2010 Metamod:Source Development Team # (C)2004-2010 Metamod:Source Development Team
# Makefile written by David "BAILOPAN" Anderson # Makefile written by David "BAILOPAN" Anderson
GIT_VERSION = $(shell sh -c 'git describe --abbrev=8 --dirty --always')
########################################### ###########################################
### EDIT THESE PATHS FOR YOUR OWN SETUP ### ### EDIT THESE PATHS FOR YOUR OWN SETUP ###
########################################### ###########################################
@ -46,6 +48,10 @@ ifeq "$(ENGINE)" "left4dead2"
CFLAGS += -DSOURCE_ENGINE=9 -DL4D2 CFLAGS += -DSOURCE_ENGINE=9 -DL4D2
endif endif
ifneq "$(GIT_VERSION)" ""
CFLAGS += -D__GIT_VERSION=\"$(GIT_VERSION)\"
endif
HL2PUB = $(HL2SDK)/public HL2PUB = $(HL2SDK)/public

View File

@ -270,7 +270,11 @@ const char *l4dtoolz::GetLicense()
const char *l4dtoolz::GetVersion() const char *l4dtoolz::GetVersion()
{ {
return "1.0.0.9f"; #ifdef __GIT_VERSION
return __GIT_VERSION;
#else
return "1.0.0.9g-unknown";
#endif
} }
const char *l4dtoolz::GetDate() const char *l4dtoolz::GetDate()