Skip to content

Commit

Permalink
TOOLS: Fix Git version detection (#3324316)
Browse files Browse the repository at this point in the history
  • Loading branch information
Templier committed Jun 27, 2011
1 parent 6f6f0c5 commit a6f0a48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions Makefile.common
Expand Up @@ -400,15 +400,14 @@ ifeq ($(origin VER_REV), undefined)
# Are there uncommitted changes? (describe --dirty is only available since 1.6.6)
VER_DIRTY := $(shell cd $(srcdir); git update-index --refresh --unmerged 1>/dev/null 2>&1; git diff-index --quiet HEAD || echo "-dirty")
# Get the working copy base revision
VER_REV := $(shell cd $(srcdir); git describe --match desc/\* | cut -d '-' -f 2-)$(VER_DIRTY)
VER_REV := $(shell cd $(srcdir); git describe | cut -d '-' -f 2-)$(VER_DIRTY)
endif
else
GITROOT := git://github.com/scummvm/scummvm-tools.git
endif

# Define the Subversion revision if available, either autodetected or
# specified by the user, but only for base/version.cpp.
# Define the Git revision if available, either autodetected or
# specified by the user, but only for version.cpp.
ifneq ($(origin VER_REV), undefined)
base/version.o: CXXFLAGS:=$(CXXFLAGS) -DSCUMMVM_REVISION=\"$(VER_REV)\"
version.o: CXXFLAGS:=$(CXXFLAGS) -DSCUMMVM_TOOLS_REVISION=\"$(VER_REV)\"
endif

6 changes: 3 additions & 3 deletions internal_version.h
@@ -1,5 +1,5 @@
#ifndef SCUMMVM_TOOLS_SVN_REVISION
#define SCUMMVM_TOOLS_SVN_REVISION
#ifndef SCUMMVM_TOOLS_REVISION
#define SCUMMVM_TOOLS_REVISION
#endif

#define SCUMMVM_TOOLS_VERSION "1.3.0git" SCUMMVM_TOOLS_SVN_REVISION
#define SCUMMVM_TOOLS_VERSION "1.3.0git" SCUMMVM_TOOLS_REVISION

0 comments on commit a6f0a48

Please sign in to comment.