mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-24 04:41:25 +00:00
--version now prints GMQCC_GITINFO, which is not not defined in gmqcc.h to some empty string, it just won't exist in release builds
This commit is contained in:
parent
f06a59e3c7
commit
7a5a328c54
3 changed files with 4 additions and 5 deletions
2
Makefile
2
Makefile
|
@ -10,7 +10,7 @@ MINGW = $(findstring MINGW32, $(UNAME))
|
||||||
|
|
||||||
CC ?= clang
|
CC ?= clang
|
||||||
CFLAGS += -Wall -Wextra -I. -fno-strict-aliasing -fsigned-char
|
CFLAGS += -Wall -Wextra -I. -fno-strict-aliasing -fsigned-char
|
||||||
CFLAGS += -DGMQCC_GITINFO="`git describe`"
|
CFLAGS += -DGMQCC_GITINFO="\"`git describe`\""
|
||||||
#turn on tons of warnings if clang is present
|
#turn on tons of warnings if clang is present
|
||||||
# but also turn off the STUPID ONES
|
# but also turn off the STUPID ONES
|
||||||
ifeq ($(CC), clang)
|
ifeq ($(CC), clang)
|
||||||
|
|
4
gmqcc.h
4
gmqcc.h
|
@ -46,10 +46,6 @@
|
||||||
#define GMQCC_VERSION \
|
#define GMQCC_VERSION \
|
||||||
GMQCC_VERSION_BUILD(GMQCC_VERSION_MAJOR, GMQCC_VERSION_MINOR, GMQCC_VERSION_PATCH)
|
GMQCC_VERSION_BUILD(GMQCC_VERSION_MAJOR, GMQCC_VERSION_MINOR, GMQCC_VERSION_PATCH)
|
||||||
|
|
||||||
#ifndef GMQCC_GITINFO
|
|
||||||
# define GMQCC_GITINFO "(no git info)"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We cannot rely on C99 at all, since compilers like MSVC
|
* We cannot rely on C99 at all, since compilers like MSVC
|
||||||
* simply don't support it. We define our own boolean type
|
* simply don't support it. We define our own boolean type
|
||||||
|
|
3
main.c
3
main.c
|
@ -51,6 +51,9 @@ static void version() {
|
||||||
__DATE__,
|
__DATE__,
|
||||||
__TIME__
|
__TIME__
|
||||||
);
|
);
|
||||||
|
#ifdef GMQCC_GITINFO
|
||||||
|
con_out("git build: %s\n", GMQCC_GITINFO);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int usage() {
|
static int usage() {
|
||||||
|
|
Loading…
Reference in a new issue