From 8fc5171a4c53b6f0e7ef7247d36ee5e05eaf0a07 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 9 Dec 2016 19:56:33 -0500 Subject: [PATCH] Report git version with library_version --- Makefile.libretro | 4 ++++ frontend/libretro.c | 5 ++++- jni/Android.mk | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile.libretro b/Makefile.libretro index a7fa0ebb..df1cec26 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -22,6 +22,10 @@ CC_AS ?= $(CC) CFLAGS ?= TARGET_NAME := pcsx_rearmed +GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" +ifneq ($(GIT_VERSION)," unknown") + CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif LIBZ := -lz LIBPTHREAD := -lpthread LIBDL := -ldl diff --git a/frontend/libretro.c b/frontend/libretro.c index 44cb9747..589f07cb 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -638,7 +638,10 @@ void retro_get_system_info(struct retro_system_info *info) { memset(info, 0, sizeof(*info)); info->library_name = "PCSX-ReARMed"; - info->library_version = "r22"; +#ifndef GIT_VERSION +#define GIT_VERSION "" +#endif + info->library_version = "r22" GIT_VERSION; info->valid_extensions = "bin|cue|img|mdf|pbp|toc|cbn|m3u"; info->need_fullpath = true; } diff --git a/jni/Android.mk b/jni/Android.mk index 43a98da9..9dd9e399 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 + APP_DIR := ../../src #fix stupid change in ndk r11 that breaks compiling even when the exe would run fine -- 2.39.5