From 77001a5577e3f76bb3694213ee3afc8f182426f5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 1 Mar 2016 18:59:12 +0100 Subject: [PATCH] (Android) More preparation for Vulkan --- gfx/common/vksym.h | 4 +++ pkg/android/phoenix/jni/Android.mk | 34 +++++++++++++------------ pkg/android/phoenix/jni/Android2.mk | 35 ++++++++++++++------------ pkg/android/phoenix/jni/Application.mk | 2 ++ 4 files changed, 43 insertions(+), 32 deletions(-) diff --git a/gfx/common/vksym.h b/gfx/common/vksym.h index 2e42db57a6..9a3ff5eee8 100644 --- a/gfx/common/vksym.h +++ b/gfx/common/vksym.h @@ -43,6 +43,10 @@ #define VK_USE_PLATFORM_WIN32_KHR #endif +#ifdef ANDROID +#define VK_USE_PLATFORM_ANDROID_KHR +#endif + #ifdef HAVE_XCB #define VK_USE_PLATFORM_XCB_KHR #endif diff --git a/pkg/android/phoenix/jni/Android.mk b/pkg/android/phoenix/jni/Android.mk index 52b2b97ee8..a331c4eddb 100644 --- a/pkg/android/phoenix/jni/Android.mk +++ b/pkg/android/phoenix/jni/Android.mk @@ -7,58 +7,61 @@ HAVE_NEON := 1 HAVE_LOGGER := 0 HAVE_VULKAN := 0 +DEFINES := + include $(CLEAR_VARS) ifeq ($(TARGET_ARCH),arm) - LOCAL_CFLAGS += -DANDROID_ARM -marm + DEFINES += -DANDROID_ARM -marm LOCAL_ARM_MODE := arm endif ifeq ($(TARGET_ARCH),x86) - LOCAL_CFLAGS += -DANDROID_X86 -DHAVE_SSSE3 + DEFINES += -DANDROID_X86 -DHAVE_SSSE3 endif ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) ifeq ($(HAVE_NEON),1) - LOCAL_CFLAGS += -D__ARM_NEON__ + DEFINES += -D__ARM_NEON__ LOCAL_SRC_FILES += $(RARCH_DIR)/audio/audio_utils_neon.S.neon LOCAL_SRC_FILES += $(RARCH_DIR)/audio/drivers_resampler/sinc_neon.S.neon LOCAL_SRC_FILES += $(RARCH_DIR)/audio/drivers_resampler/cc_resampler_neon.S.neon endif -LOCAL_CFLAGS += -DSINC_LOWER_QUALITY - -LOCAL_CFLAGS += -DANDROID_ARM_V7 +DEFINES += -DSINC_LOWER_QUALITY +DEFINES += -DANDROID_ARM_V7 endif ifeq ($(TARGET_ARCH),mips) - LOCAL_CFLAGS += -DANDROID_MIPS -D__mips__ -D__MIPSEL__ + DEFINES += -DANDROID_MIPS -D__mips__ -D__MIPSEL__ endif LOCAL_MODULE := retroarch-activity -LOCAL_SRC_FILES += $(RARCH_DIR)/griffin/griffin.c +LOCAL_SRC_FILES += $(RARCH_DIR)/griffin/griffin.c $(RARCH_DIR)/griffin/griffin_cpp.cpp ifeq ($(HAVE_LOGGER), 1) - LOCAL_CFLAGS += -DHAVE_LOGGER + DEFINES += -DHAVE_LOGGER endif LOGGER_LDLIBS := -llog ifeq ($(GLES),3) GLES_LIB := -lGLESv3 - LOCAL_CFLAGS += -DHAVE_OPENGLES3 + DEFINES += -DHAVE_OPENGLES3 else GLES_LIB := -lGLESv2 endif - -LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -fno-stack-protector -funroll-loops -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_EGL -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DHAVE_RPNG -DINLINE=inline -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_NETWORKING -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_MATERIALUI -DHAVE_XMB -std=gnu99 -DHAVE_LIBRETRODB -DHAVE_STB_FONT +DEFINES += -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_EGL -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DHAVE_RPNG -DINLINE=inline -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_NETWORKING -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_MATERIALUI -DHAVE_XMB -DHAVE_LIBRETRODB -DHAVE_STB_FONT ifeq ($(HAVE_VULKAN),1) -LOCAL_CFLAGS += -DHAVE_VULKAN +DEFINES += -DHAVE_VULKAN endif +DEFINES += -DHAVE_7ZIP +DEFINES += -DHAVE_CHEEVOS +DEFINES += -DHAVE_SL -LOCAL_CFLAGS += -DHAVE_7ZIP -LOCAL_CFLAGS += -DHAVE_CHEEVOS +LOCAL_CFLAGS += -Wall -std=gnu99 -pthread -Wno-unused-function -fno-stack-protector -funroll-loops $(DEFINES) +LOCAL_CPPFLAGS := -std=gnu++11 $(DEFINES) # Let ndk-build set the optimization flags but remove -O3 like in cf3c3 LOCAL_CFLAGS := $(subst -O3,-O2,$(LOCAL_CFLAGS)) @@ -70,7 +73,6 @@ ifeq ($(HAVE_VULKAN),1) LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(RARCH_DIR)/gfx/include endif -LOCAL_CFLAGS += -DHAVE_SL LOCAL_LDLIBS += -lOpenSLES -lz ifneq ($(SANITIZER),) diff --git a/pkg/android/phoenix/jni/Android2.mk b/pkg/android/phoenix/jni/Android2.mk index 39b8094ff9..5a5875bfbf 100644 --- a/pkg/android/phoenix/jni/Android2.mk +++ b/pkg/android/phoenix/jni/Android2.mk @@ -7,31 +7,32 @@ HAVE_NEON := 1 HAVE_LOGGER := 0 HAVE_VULKAN := 0 +DEFINES := + include $(CLEAR_VARS) ifeq ($(TARGET_ARCH),arm) - LOCAL_CFLAGS += -DANDROID_ARM -marm + DEFINES += -DANDROID_ARM -marm LOCAL_ARM_MODE := arm endif ifeq ($(TARGET_ARCH),x86) - LOCAL_CFLAGS += -DANDROID_X86 -DHAVE_SSSE3 + DEFINES += -DANDROID_X86 -DHAVE_SSSE3 endif ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) ifeq ($(HAVE_NEON),1) - LOCAL_CFLAGS += -D__ARM_NEON__ + DEFINES += -D__ARM_NEON__ LOCAL_SRC_FILES += $(RARCH_DIR)/audio/audio_utils_neon.S.neon LOCAL_SRC_FILES += $(RARCH_DIR)/audio/drivers_resampler/sinc_neon.S.neon LOCAL_SRC_FILES += $(RARCH_DIR)/audio/drivers_resampler/cc_resampler_neon.S.neon endif -LOCAL_CFLAGS += -DSINC_LOWER_QUALITY - -LOCAL_CFLAGS += -DANDROID_ARM_V7 +DEFINES += -DSINC_LOWER_QUALITY +DEFINES += -DANDROID_ARM_V7 endif ifeq ($(TARGET_ARCH),mips) - LOCAL_CFLAGS += -DANDROID_MIPS -D__mips__ -D__MIPSEL__ + DEFINES += -DANDROID_MIPS -D__mips__ -D__MIPSEL__ endif LOCAL_MODULE := retroarch-activity @@ -39,27 +40,30 @@ LOCAL_MODULE := retroarch-activity LOCAL_SRC_FILES += $(RARCH_DIR)/griffin/griffin.c ifeq ($(HAVE_LOGGER), 1) - LOCAL_CFLAGS += -DHAVE_LOGGER + DEFINES += -DHAVE_LOGGER endif LOGGER_LDLIBS := -llog ifeq ($(GLES),3) GLES_LIB := -lGLESv3 - LOCAL_CFLAGS += -DHAVE_OPENGLES3 + DEFINES += -DHAVE_OPENGLES3 else GLES_LIB := -lGLESv2 endif - -LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -fno-stack-protector -funroll-loops -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DHAVE_RPNG -DINLINE=inline -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_NETWORKING -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_MATERIALUI -DHAVE_XMB -std=gnu99 -DHAVE_LIBRETRODB -DHAVE_STB_FONT +DEFINES += -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DHAVE_RPNG -DINLINE=inline -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_NETWORKING -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_MATERIALUI -DHAVE_XMB -std=gnu99 -DHAVE_LIBRETRODB -DHAVE_STB_FONT ifeq ($(HAVE_VULKAN),1) -LOCAL_CFLAGS += -DHAVE_VULKAN +DEFINES += -DHAVE_VULKAN endif -LOCAL_CFLAGS += -DHAVE_7ZIP -LOCAL_CFLAGS += -DHAVE_CHEEVOS -LOCAL_CFLAGS += -DDEBUG_ANDROID +DEFINES += -DHAVE_7ZIP +DEFINES += -DHAVE_CHEEVOS +DEFINES += -DDEBUG_ANDROID +DEFINES += -DHAVE_SL + +LOCAL_CFLAGS += -Wall -std=gnu99 -pthread -Wno-unused-function -fno-stack-protector -funroll-loops $(DEFINES) +LOCAL_CPPFLAGS := -std=gnu++11 $(DEFINES) ifeq ($(NDK_DEBUG),1) LOCAL_CFLAGS += -O0 -g @@ -74,7 +78,6 @@ ifeq ($(HAVE_VULKAN),1) LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(RARCH_DIR)/gfx/include endif -LOCAL_CFLAGS += -DHAVE_SL LOCAL_LDLIBS += -lOpenSLES -lz include $(BUILD_SHARED_LIBRARY) diff --git a/pkg/android/phoenix/jni/Application.mk b/pkg/android/phoenix/jni/Application.mk index 97dd6dcb5b..1763880a0c 100644 --- a/pkg/android/phoenix/jni/Application.mk +++ b/pkg/android/phoenix/jni/Application.mk @@ -38,3 +38,5 @@ ifeq ($(USE_CLANG),1) APP_CFLAGS := -Wno-invalid-source-encoding APP_CPPFLAGS := -Wno-invalid-source-encoding endif + +APP_STL := gnustl_static