libretro: set version with git sha
Read version from `CHANGELOG.md` and append the short git sha if not on the released commit. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
8abbb070e8
commit
4203bb53f2
|
@ -28,9 +28,16 @@ endif
|
|||
endif
|
||||
|
||||
TARGET_NAME = vbam
|
||||
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
|
||||
ifneq ($(GIT_VERSION)," unknown")
|
||||
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
|
||||
VBAM_VERSION := $(shell sed -En 's/.*\[([0-9]+[^]]+).*/\1/p; T; q' ../../CHANGELOG.md 2>/dev/null)
|
||||
|
||||
CXXFLAGS += -DVBAM_VERSION=\"$(VBAM_VERSION)\"
|
||||
|
||||
TAG_COMMIT := $(shell git rev-list -n 1 v$(VBAM_VERSION) --abbrev-commit 2>/dev/null)
|
||||
CURRENT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
|
||||
|
||||
ifneq ($(CURRENT_COMMIT),$(TAG_COMMIT))
|
||||
CXXFLAGS += -DGIT_COMMIT=\"$(CURRENT_COMMIT)\"
|
||||
endif
|
||||
|
||||
ifeq ($(platform), unix)
|
||||
|
|
|
@ -534,10 +534,10 @@ void retro_get_system_info(struct retro_system_info *info)
|
|||
{
|
||||
info->need_fullpath = false;
|
||||
info->valid_extensions = "dmg|gb|gbc|cgb|sgb|gba";
|
||||
#ifdef GIT_VERSION
|
||||
info->library_version = "2.1.0" GIT_VERSION;
|
||||
#ifdef GIT_COMMIT
|
||||
info->library_version = VBAM_VERSION "-" GIT_COMMIT;
|
||||
#else
|
||||
info->library_version = "2.1.0-GIT";
|
||||
info->library_version = VBAM_VERSION;
|
||||
#endif
|
||||
info->library_name = "VBA-M";
|
||||
info->block_extract = false;
|
||||
|
|
Loading…
Reference in New Issue