]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
--version now prints GMQCC_GITINFO, which is not not defined in gmqcc.h to some empty...
authorWolfgang Bumiller <blub@speed.at>
Thu, 10 Jan 2013 15:07:33 +0000 (16:07 +0100)
committerWolfgang Bumiller <blub@speed.at>
Thu, 10 Jan 2013 15:07:33 +0000 (16:07 +0100)
Makefile
gmqcc.h
main.c

index 52e7270fd66a705fe4e8c9b87f89791c4406a55d..1d8b1c42d38a8203728598ec78618ce419d58f95 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ MINGW   = $(findstring MINGW32, $(UNAME))
 
 CC     ?= clang
 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
 # but also turn off the STUPID ONES
 ifeq ($(CC), clang)
diff --git a/gmqcc.h b/gmqcc.h
index b9aca8378f44c8c29c78c3347fc04e5ebcf871be..b1657ff8ed855a754032663f97b73cd040b67f7c 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
 #define GMQCC_VERSION \
     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
  * simply don't support it.  We define our own boolean type
diff --git a/main.c b/main.c
index 065867775352388a8e2d617480a1331714f7929e..ff0e41dc7f3adc30ef38fbda0d79c61ae2df13c1 100644 (file)
--- a/main.c
+++ b/main.c
@@ -51,6 +51,9 @@ static void version() {
         __DATE__,
         __TIME__
     );
+#ifdef GMQCC_GITINFO
+    con_out("git build: %s\n", GMQCC_GITINFO);
+#endif
 }
 
 static int usage() {