Automatically generate PRODUCT_VER_BARE based on the current git revision
This commit is contained in:
@@ -77,6 +77,7 @@ GtkModule.so
|
|||||||
# StepMania Specific
|
# StepMania Specific
|
||||||
*.smzip
|
*.smzip
|
||||||
ver.cpp
|
ver.cpp
|
||||||
|
gitversion.h
|
||||||
Cache/
|
Cache/
|
||||||
Save/
|
Save/
|
||||||
Logs/
|
Logs/
|
||||||
|
|||||||
@@ -349,6 +349,7 @@ AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
|
|||||||
# Always:
|
# Always:
|
||||||
AC_DEFINE(_GNU_SOURCE, 1, [Use GNU extensions])
|
AC_DEFINE(_GNU_SOURCE, 1, [Use GNU extensions])
|
||||||
AC_DEFINE(__STDC_FORMAT_MACROS, 1, [Use PRId64 and similar])
|
AC_DEFINE(__STDC_FORMAT_MACROS, 1, [Use PRId64 and similar])
|
||||||
|
AC_DEFINE(USE_GITVERSION, 1, [We are generating gitversion.h])
|
||||||
|
|
||||||
AM_CONDITIONAL(HAVE_ALSA, test x$alsa != xfalse )
|
AM_CONDITIONAL(HAVE_ALSA, test x$alsa != xfalse )
|
||||||
AM_CONDITIONAL(HAVE_GTK, test "$enable_gtk2" != "no" )
|
AM_CONDITIONAL(HAVE_GTK, test "$enable_gtk2" != "no" )
|
||||||
|
|||||||
+12
-2
@@ -28,7 +28,7 @@ AM_CXXFLAGS += -finline-limit=300
|
|||||||
|
|
||||||
AM_CXXFLAGS += $(GL_CFLAGS)
|
AM_CXXFLAGS += $(GL_CFLAGS)
|
||||||
|
|
||||||
.PHONY: increment_version
|
.PHONY: increment_version gitversion
|
||||||
|
|
||||||
increment_version:
|
increment_version:
|
||||||
if test -e ver.h; then \
|
if test -e ver.h; then \
|
||||||
@@ -43,6 +43,16 @@ increment_version:
|
|||||||
|
|
||||||
ver.cpp: increment_version
|
ver.cpp: increment_version
|
||||||
|
|
||||||
|
gitversion:
|
||||||
|
rm -f gitversion.h
|
||||||
|
touch gitversion.h
|
||||||
|
if git rev-parse --short HEAD; then \
|
||||||
|
echo "#define PRODUCT_VER_BARE 5.0-git-`git rev-parse --short HEAD`" > gitversion.h; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
gitversion.h: gitversion
|
||||||
|
ProductInfo.h: gitversion.h
|
||||||
|
|
||||||
PNG = \
|
PNG = \
|
||||||
../extern/libpng/include/png.c ../extern/libpng/include/.png.h \
|
../extern/libpng/include/png.c ../extern/libpng/include/.png.h \
|
||||||
../extern/libpng/include/pngconf.h ../extern/libpng/include/pngdebug.h \
|
../extern/libpng/include/pngconf.h ../extern/libpng/include/pngdebug.h \
|
||||||
@@ -734,7 +744,7 @@ main_LDADD = \
|
|||||||
$(GL_LIBS) \
|
$(GL_LIBS) \
|
||||||
libtomcrypt.a libtommath.a
|
libtomcrypt.a libtommath.a
|
||||||
|
|
||||||
nodist_stepmania_SOURCES = ver.cpp
|
nodist_stepmania_SOURCES = ver.cpp gitversion.h
|
||||||
|
|
||||||
stepmania_CPPFLAGS = $(main_CPPFLAGS)
|
stepmania_CPPFLAGS = $(main_CPPFLAGS)
|
||||||
stepmania_SOURCES = $(main_SOURCES)
|
stepmania_SOURCES = $(main_SOURCES)
|
||||||
|
|||||||
+8
-2
@@ -3,6 +3,12 @@
|
|||||||
#ifndef PRODUCT_INFO_H
|
#ifndef PRODUCT_INFO_H
|
||||||
#define PRODUCT_INFO_H
|
#define PRODUCT_INFO_H
|
||||||
|
|
||||||
|
// XXX: VC doesn't generate this yet. Hack around it for now
|
||||||
|
#include "config.h"
|
||||||
|
#ifdef USE_GITVERSION
|
||||||
|
#include "gitversion.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief A friendly string to refer to the product in crash dialogs, etc.
|
* @brief A friendly string to refer to the product in crash dialogs, etc.
|
||||||
*
|
*
|
||||||
@@ -16,7 +22,7 @@
|
|||||||
* As an example, use "StepMania4" here, not "StepMania".
|
* As an example, use "StepMania4" here, not "StepMania".
|
||||||
* It would cause a conflict with older versions such as StepMania 3.X.
|
* It would cause a conflict with older versions such as StepMania 3.X.
|
||||||
*/
|
*/
|
||||||
#define PRODUCT_ID_BARE StepMania 5
|
#define PRODUCT_ID_BARE StepMania 5.0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Version info displayed to the user.
|
* @brief Version info displayed to the user.
|
||||||
@@ -30,7 +36,7 @@
|
|||||||
* </li></ul>
|
* </li></ul>
|
||||||
*/
|
*/
|
||||||
#ifndef PRODUCT_VER_BARE
|
#ifndef PRODUCT_VER_BARE
|
||||||
#define PRODUCT_VER_BARE v5.0 beta 4a
|
#define PRODUCT_VER_BARE 5.0-UNKNOWN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user