From 415b5ba67bd7f07dcb87d4841da69b0c3254e5c0 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 9 Dec 2016 18:42:12 -0500 Subject: [PATCH] Report git version with library_version --- Makefile | 4 ++++ jni/Android.mk | 5 +++++ libretro.c | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b7b35a5..d0d8b7d 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,10 @@ else ifneq ($(findstring Darwin,$(UNAME)),) endif TARGET_NAME := gpsp +GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" +ifneq ($(GIT_VERSION)," unknown") + CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif LIBM := -lm CORE_DIR := . LDFLAGS := diff --git a/jni/Android.mk b/jni/Android.mk index 442daa9..05a96c9 100644 --- a/jni/Android.mk +++ b/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 + LOCAL_MODULE := retro CPU_ARCH := diff --git a/libretro.c b/libretro.c index 095cdd0..dfe6cbe 100644 --- a/libretro.c +++ b/libretro.c @@ -116,7 +116,10 @@ extern struct retro_perf_callback perf_cb; void retro_get_system_info(struct retro_system_info* info) { info->library_name = "gpSP"; - info->library_version = "v0.91"; +#ifndef GIT_VERSION +#define GIT_VERSION "" +#endif + info->library_version = "v0.91" GIT_VERSION; info->need_fullpath = true; info->block_extract = false; info->valid_extensions = "gba|bin|agb|gbz" ;