Merge pull request #3 from orbea/git_version

libretro: Add GIT_VERSION
This commit is contained in:
Twinaphex 2017-12-22 06:25:57 +01:00 committed by GitHub
commit 2a69081e53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 3 deletions

View File

@ -1,6 +1,11 @@
STATIC_LINKING := 0 STATIC_LINKING := 0
AR := ar AR := ar
GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
ifeq ($(platform),) ifeq ($(platform),)
platform = unix platform = unix
ifeq ($(shell uname -a),) ifeq ($(shell uname -a),)

View File

@ -1,7 +1,11 @@
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
LOCAL_CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
include $(CLEAR_VARS)
HAVE_NETWORK = 1 HAVE_NETWORK = 1
LOCAL_MODULE := libretro LOCAL_MODULE := libretro

View File

@ -14,6 +14,8 @@
#define snprintf _snprintf #define snprintf _snprintf
#endif #endif
#define SAMEBOY_CORE_VERSION "0.9"
#include <Core/gb.h> #include <Core/gb.h>
#include "libretro.h" #include "libretro.h"
@ -168,12 +170,15 @@ void retro_get_system_info(struct retro_system_info *info)
{ {
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
info->library_name = "SameBoy"; info->library_name = "SameBoy";
info->library_version = "0.9"; #ifdef GIT_VERSION
info->library_version = SAMEBOY_CORE_VERSION GIT_VERSION;
#else
info->library_version = SAMEBOY_CORE_VERSION;
#endif
info->need_fullpath = true; info->need_fullpath = true;
info->valid_extensions = "gb|gbc"; info->valid_extensions = "gb|gbc";
} }
void retro_get_system_av_info(struct retro_system_av_info *info) void retro_get_system_av_info(struct retro_system_av_info *info)
{ {
struct retro_game_geometry geom = { VIDEO_WIDTH, VIDEO_HEIGHT,VIDEO_WIDTH, VIDEO_HEIGHT ,160.0 / 144.0 }; struct retro_game_geometry geom = { VIDEO_WIDTH, VIDEO_HEIGHT,VIDEO_WIDTH, VIDEO_HEIGHT ,160.0 / 144.0 };