From ccfbb241f4d1a2dbefe684e747c1920da498cbfe Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 9 Dec 2016 17:34:44 -0500 Subject: Use git version as library_version --- Makefile | 4 ++++ jni/Android.mk | 4 ++++ libretro.c | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3a87d57..e8620ac 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,10 @@ TARGET_NAME := snes9x2005_plus else TARGET_NAME := snes9x2005 endif +GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" +ifneq ($(GIT_VERSION)," unknown") + CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif DEFS := LIBM := -lm diff --git a/jni/Android.mk b/jni/Android.mk index 68b2017..b890e2f 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -1,4 +1,8 @@ LOCAL_PATH := $(call my-dir) +GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" +ifneq ($(GIT_VERSION)," unknown") + LOCAL_CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif include $(CLEAR_VARS) diff --git a/libretro.c b/libretro.c index 7f26a19..65163f5 100644 --- a/libretro.c +++ b/libretro.c @@ -696,7 +696,10 @@ void retro_get_system_info(struct retro_system_info* info) info->need_fullpath = true; #endif info->valid_extensions = "smc|fig|sfc|gd3|gd7|dx2|bsx|swc"; - info->library_version = "v1.36"; +#ifndef GIT_VERSION +#define GIT_VERSION "" +#endif + info->library_version = "v1.36" GIT_VERSION; #ifdef USE_BLARGG_APU info->library_name = "Snes9x 2005 Plus"; #else -- cgit v1.2.3