From d9b6dd3fb363df4d4b57b19b33307273ed650ac7 Mon Sep 17 00:00:00 2001
From: Andrei Sabalenka <[EMAIL REDACTED]>
Date: Fri, 20 Sep 2024 16:36:46 +0300
Subject: [PATCH] Android.mk: add GME support
(cherry picked from commit 66a206c0f22c037f3e8fb69b0c3f1edeb39d55bd)
---
Android.mk | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Android.mk b/Android.mk
index 832fe035..dc0b2954 100644
--- a/Android.mk
+++ b/Android.mk
@@ -30,6 +30,10 @@ MPG123_LIBRARY_PATH := external/mpg123
SUPPORT_WAVPACK ?= true
WAVPACK_LIBRARY_PATH := external/wavpack
+# Enable this if you want to support loading music via libgme
+SUPPORT_GME ?= true
+GME_LIBRARY_PATH := external/libgme
+
# Enable this if you want to support loading MOD music via XMP-lite
SUPPORT_MOD_XMP ?= false
XMP_LIBRARY_PATH := external/libxmp
@@ -60,6 +64,11 @@ ifeq ($(SUPPORT_WAVPACK),true)
include $(SDL_MIXER_LOCAL_PATH)/$(WAVPACK_LIBRARY_PATH)/Android.mk
endif
+# Build the library
+ifeq ($(SUPPORT_GME),true)
+ include $(SDL_MIXER_LOCAL_PATH)/$(GME_LIBRARY_PATH)/Android.mk
+endif
+
# Build the library
ifeq ($(SUPPORT_MOD_XMP),true)
include $(SDL_MIXER_LOCAL_PATH)/$(XMP_LIBRARY_PATH)/Android.mk
@@ -136,6 +145,12 @@ ifeq ($(SUPPORT_WAVPACK),true)
LOCAL_STATIC_LIBRARIES += wavpack
endif
+ifeq ($(SUPPORT_GME),true)
+ LOCAL_CFLAGS += -DMUSIC_GME
+ LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(GME_LIBRARY_PATH)
+ LOCAL_STATIC_LIBRARIES += libgme
+endif
+
ifeq ($(SUPPORT_MOD_XMP),true)
LOCAL_CFLAGS += -DMUSIC_MOD_XMP -DLIBXMP_HEADER=\"../external/libxmp/include/xmp.h\"
LOCAL_STATIC_LIBRARIES += xmp