From: Gregor Richards Date: Fri, 9 Dec 2016 23:50:07 +0000 (-0500) Subject: Report git version with library_version X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d4f989df99867149b8fe9a7f2d9a11799f469af;p=picodrive.git Report git version with library_version --- diff --git a/Makefile.libretro b/Makefile.libretro index b2759d8e..07da2660 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -25,6 +25,10 @@ CFLAGS ?= TARGET_NAME := picodrive LIBM := -lm +GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" +ifneq ($(GIT_VERSION)," unknown") + CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif asm_memory = 0 asm_render = 0 diff --git a/jni/Android.mk b/jni/Android.mk index 60d6f7de..f94aba2e 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 + #fix stupid change in ndk r11 that breaks compiling even when the exe would run fine LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index 061f830d..9588bc88 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -539,7 +539,10 @@ void retro_get_system_info(struct retro_system_info *info) { memset(info, 0, sizeof(*info)); info->library_name = "PicoDrive"; - info->library_version = VERSION; +#ifndef GIT_VERSION +#define GIT_VERSION "" +#endif + info->library_version = VERSION GIT_VERSION; info->valid_extensions = "bin|gen|smd|md|32x|cue|iso|sms"; info->need_fullpath = true; }