From 39821e9ad3f28ce910112f5dc5354f6805a83d7a Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 3 Jan 2020 13:25:26 +0800 Subject: [PATCH] Allow compiling mcpp with android --- android/Android.mk | 13 ++++++++++++- lib/mcpp/config.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/android/Android.mk b/android/Android.mk index aa0a77c02..47f40ae77 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -161,6 +161,16 @@ include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) +# MCPP +LOCAL_MODULE := mcpp +LOCAL_PATH := . +LOCAL_CPP_FEATURES += rtti +LOCAL_SRC_FILES := $(wildcard ../lib/mcpp/*.c) +LOCAL_CFLAGS := -DMCPP_LIB -DHAVE_CONFIG_H +include $(BUILD_STATIC_LIBRARY) +include $(CLEAR_VARS) + + # Irrlicht LOCAL_MODULE := irrlicht LOCAL_PATH := . @@ -197,6 +207,7 @@ LOCAL_CFLAGS := -I../lib/angelscript/include \ -I../lib/irrlicht/include \ -I../lib/irrlicht/source/Irrlicht \ -I../lib/graphics_utils \ + -I../lib/mcpp \ -I../src \ -Iobj/curl/include \ -Iobj/fribidi/include \ @@ -218,7 +229,7 @@ LOCAL_CFLAGS := -I../lib/angelscript/include \ -DANDROID_PACKAGE_CALLBACK_NAME=$(PACKAGE_CALLBACK_NAME) LOCAL_CPPFLAGS := -std=gnu++0x -LOCAL_STATIC_LIBRARIES := irrlicht bullet enet ifaddrs angelscript \ +LOCAL_STATIC_LIBRARIES := irrlicht bullet enet ifaddrs angelscript mcpp \ vorbisfile vorbis ogg openal curl libssl libcrypto \ gnustl_static raqm fribidi harfbuzz freetype graphics_utils diff --git a/lib/mcpp/config.h b/lib/mcpp/config.h index 410a5304b..a7d9a9a6d 100644 --- a/lib/mcpp/config.h +++ b/lib/mcpp/config.h @@ -52,6 +52,40 @@ /* Define the target system. */ #define SYSTEM SYS_MAC +#elif defined(ANDROID) + +// Android. + +/* Define to 1 if the system has the type `intmax_t'. */ +#define HAVE_INTMAX_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the `stpcpy' function. */ +#define HAVE_STPCPY 0 + +/* Define the host compiler. */ +#define HOST_COMPILER GNUC + +/* Define the host system. */ +#define HOST_SYSTEM SYS_LINUX + +/* Define printf length modifier for the longest integer. */ +#define LL_FORM "j" + +/* Define the suffix of object file. */ +#define OBJEXT "o" + +/* Define the target system. */ +#define SYSTEM SYS_LINUX + #else // Linux.