From fd06e074bb6d9836db8f7f6dbca5c3a2f6a050c8 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 9 Dec 2016 18:07:12 -0500 Subject: [PATCH] Report git version with library_version --- Makefile.libretro | 4 ++++ libretro/jni/Android.mk | 5 +++++ libretro/libretro.c | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile.libretro b/Makefile.libretro index a944873..027411f 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -36,6 +36,10 @@ endif TARGET_NAME := genesis_plus_gx LIBM := -lm +GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" +ifneq ($(GIT_VERSION)," unknown") + CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif # Unix ifeq ($(platform), unix) diff --git a/libretro/jni/Android.mk b/libretro/jni/Android.mk index d081632..2058772 100644 --- a/libretro/jni/Android.mk +++ b/libretro/jni/Android.mk @@ -2,6 +2,11 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) +GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" +ifneq ($(GIT_VERSION)," unknown") + LOCAL_CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif + WANT_CRC32 := 1 CORE_DIR := ../.. diff --git a/libretro/libretro.c b/libretro/libretro.c index 94e73e5..ba5b7f9 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -1664,7 +1664,10 @@ void retro_set_input_state(retro_input_state_t cb) { input_state_cb = cb; } void retro_get_system_info(struct retro_system_info *info) { info->library_name = "Genesis Plus GX"; - info->library_version = "v1.7.4"; +#ifndef GIT_VERSION +#define GIT_VERSION "" +#endif + info->library_version = "v1.7.4" GIT_VERSION; info->valid_extensions = "mdx|md|smd|gen|bin|cue|iso|sms|gg|sg"; info->block_extract = false; info->need_fullpath = true;