Skip to content

Commit

Permalink
Merge pull request #18 from GregorR/libretro-git-version-v2
Browse files Browse the repository at this point in the history
Follow the convention used in (some) other cores
  • Loading branch information
inactive123 committed Dec 9, 2016
2 parents fba476c + d5b2972 commit 2334b50
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile.libretro
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ else ifneq ($(findstring MINGW,$(shell uname -a)),)
endif

TARGET_NAME := 2048
GIT_VERSION := "$(shell git describe --abbrev=7 --dirty --always --tags || echo unknown)"
ifneq ($(GIT_VERSION),"unknown")
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
LIBM := -lm
Expand Down
5 changes: 5 additions & 0 deletions jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ include $(CLEAR_VARS)

LOCAL_MODULE := retro

GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
LOCAL_CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif

ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DANDROID_ARM
LOCAL_ARM_MODE := arm
Expand Down
7 changes: 3 additions & 4 deletions libretro.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@ void retro_get_system_info(struct retro_system_info *info)
{
memset(info, 0, sizeof(*info));
info->library_name = "2048";
#ifdef GIT_VERSION
info->library_version = GIT_VERSION;
#else
info->library_version = "v1.0";
#ifndef GIT_VERSION
#define GIT_VERSION ""
#endif
info->library_version = "v1.0" GIT_VERSION;
info->need_fullpath = false;
info->valid_extensions = NULL; /* Anything is fine, we don't care. */
}
Expand Down

0 comments on commit 2334b50

Please sign in to comment.