diff --git a/libretro/Makefile b/libretro/Makefile index bbbfe3df..6317e200 100644 --- a/libretro/Makefile +++ b/libretro/Makefile @@ -1,6 +1,11 @@ STATIC_LINKING := 0 AR := ar +GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)" +ifneq ($(GIT_VERSION)," unknown") + CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif + ifeq ($(platform),) platform = unix ifeq ($(shell uname -a),) diff --git a/libretro/jni/Android.mk b/libretro/jni/Android.mk index 219b8b75..1dc2b3e2 100644 --- a/libretro/jni/Android.mk +++ b/libretro/jni/Android.mk @@ -1,7 +1,11 @@ LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) +GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)" +ifneq ($(GIT_VERSION)," unknown") + LOCAL_CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif +include $(CLEAR_VARS) HAVE_NETWORK = 1 LOCAL_MODULE := libretro diff --git a/libretro/libretro.c b/libretro/libretro.c index ef1dc1fa..7320a7ac 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -14,6 +14,8 @@ #define snprintf _snprintf #endif +#define SAMEBOY_CORE_VERSION "0.9" + #include #include "libretro.h" @@ -168,12 +170,15 @@ void retro_get_system_info(struct retro_system_info *info) { memset(info, 0, sizeof(*info)); info->library_name = "SameBoy"; - info->library_version = "0.9"; +#ifdef GIT_VERSION + info->library_version = SAMEBOY_CORE_VERSION GIT_VERSION; +#else + info->library_version = SAMEBOY_CORE_VERSION; +#endif info->need_fullpath = true; info->valid_extensions = "gb|gbc"; } - void retro_get_system_av_info(struct retro_system_av_info *info) { struct retro_game_geometry geom = { VIDEO_WIDTH, VIDEO_HEIGHT,VIDEO_WIDTH, VIDEO_HEIGHT ,160.0 / 144.0 };