Merge pull request #198 from Ryunam/git-version

Show commit hash in core version
This commit is contained in:
Autechre 2021-08-15 17:21:58 +02:00 committed by GitHub
commit 2c16ba85fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View File

@ -58,6 +58,11 @@ TARGET_NAME := gambatte
version_script = libgambatte/libretro/link.T version_script = libgambatte/libretro/link.T
core_installdir := $(prefix)/lib core_installdir := $(prefix)/lib
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
# Unix # Unix
ifneq (,$(findstring unix,$(platform))) ifneq (,$(findstring unix,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so TARGET := $(TARGET_NAME)_libretro.so

View File

@ -14,6 +14,11 @@ ifeq ($(HAVE_NETWORK),1)
COREFLAGS += -DHAVE_NETWORK COREFLAGS += -DHAVE_NETWORK
endif endif
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := retro LOCAL_MODULE := retro
LOCAL_SRC_FILES := $(SOURCES_CXX) $(SOURCES_C) LOCAL_SRC_FILES := $(SOURCES_CXX) $(SOURCES_C)

View File

@ -869,10 +869,13 @@ static blipper_t *resampler_r;
void retro_get_system_info(struct retro_system_info *info) void retro_get_system_info(struct retro_system_info *info)
{ {
info->library_name = "Gambatte"; info->library_name = "Gambatte";
#ifndef GIT_VERSION
#define GIT_VERSION ""
#endif
#ifdef HAVE_NETWORK #ifdef HAVE_NETWORK
info->library_version = "v0.5.0-netlink"; info->library_version = "v0.5.0-netlink" GIT_VERSION;
#else #else
info->library_version = "v0.5.0"; info->library_version = "v0.5.0" GIT_VERSION;
#endif #endif
info->need_fullpath = false; info->need_fullpath = false;
info->block_extract = false; info->block_extract = false;