SDL: fixed optimization flags for debug builds, I can finally run ndk-gdb because I've got a new phone yay

This commit is contained in:
Sergii Pylypenko
2018-12-05 20:15:36 +02:00
parent bf0eb74ea8
commit eec2e53f0f
5 changed files with 20 additions and 5 deletions

View File

@@ -3,7 +3,10 @@ APP_PROJECT_PATH := $(call my-dir)/..
include jni/Settings.mk
APP_STL := c++_static
APP_CFLAGS := -Oz -DNDEBUG -g # -Oz works best with clang
APP_CFLAGS := -g
ifneq ($(NDK_DEBUG),1)
APP_CFLAGS += -Oz -DNDEBUG # -Oz works best with clang
endif
APP_PIE := true # This feature makes executables incompatible to Android API 15 or lower, but executables without PIE will not run on Android 5.0 and newer
SDL_EXCLUDE_LIBGCC := -Wl,--exclude-libs,libgcc.a
SDL_EXCLUDE_LIBUNWIND := -Wl,--exclude-libs,libunwind.a

View File

@@ -9,7 +9,7 @@ $(error Please define SDL_JAVA_PACKAGE_PATH to the path of your Java package wit
endif
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_CFLAGS := -O3 \
LOCAL_CFLAGS := \
-DSDL_JAVA_PACKAGE_PATH=$(SDL_JAVA_PACKAGE_PATH) \
-DSDL_CURDIR_PATH=\"$(SDL_CURDIR_PATH)\" \
-DSDL_TRACKBALL_KEYUP_DELAY=$(SDL_TRACKBALL_KEYUP_DELAY) \
@@ -17,6 +17,10 @@ LOCAL_CFLAGS := -O3 \
-DSDL_VIDEO_RENDER_RESIZE=$(SDL_VIDEO_RENDER_RESIZE) \
$(SDL_ADDITIONAL_CFLAGS)
ifneq ($(NDK_DEBUG),1)
LOCAL_CFLAGS += -O3 -DNDEBUG
endif
SDL_SRCS := \
src/*.c \
src/audio/*.c \

View File

@@ -856,7 +856,7 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMotionEvent) ( JNIEnv* env, jobject t
return;
#endif
__android_log_print(ANDROID_LOG_INFO, "libSDL", "Motion event: %4d %4d action %d ptr %d, force %d radius %d", x, y, action, pointerId, force, radius);
//__android_log_print(ANDROID_LOG_INFO, "libSDL", "Motion event: %4d %4d action %d ptr %d, force %d radius %d", x, y, action, pointerId, force, radius);
pointerId = BumpPointerId( pointerId );

View File

@@ -5,11 +5,15 @@ include $(CLEAR_VARS)
LOCAL_MODULE := sdl_image
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/../jpeg/include $(LOCAL_PATH)/../png/include $(LOCAL_PATH)/../sdl-$(SDL_VERSION)/include $(LOCAL_PATH)/include
LOCAL_CFLAGS := -O3 \
LOCAL_CFLAGS := \
-DLOAD_JPG -DLOAD_PNG -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM \
-DLOAD_PCX -DLOAD_PNM -DLOAD_TGA -DLOAD_XCF -DLOAD_XPM \
-DLOAD_XV
ifneq ($(NDK_DEBUG),1)
LOCAL_CFLAGS += -O3 -DNDEBUG
endif
LOCAL_CPP_EXTENSION := .cpp
LOCAL_SRC_FILES := $(notdir $(wildcard $(LOCAL_PATH)/*.c))

View File

@@ -8,7 +8,11 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/../sdl-$(SDL_VERSION)/include $(
$(LOCAL_PATH)/../mad/include $(LOCAL_PATH)/../flac/include $(LOCAL_PATH)/../ogg/include \
$(LOCAL_PATH)/../vorbis/include $(LOCAL_PATH)/../tremor/include $(LOCAL_PATH)/../mikmod/include \
$(LOCAL_PATH)/timidity
LOCAL_CFLAGS := -O3 -DWAV_MUSIC -DOGG_MUSIC -DFLAC_MUSIC -DMOD_MUSIC -DMID_MUSIC -DUSE_TIMIDITY_MIDI
LOCAL_CFLAGS := -DWAV_MUSIC -DOGG_MUSIC -DFLAC_MUSIC -DMOD_MUSIC -DMID_MUSIC -DUSE_TIMIDITY_MIDI
ifneq ($(NDK_DEBUG),1)
LOCAL_CFLAGS += -O3 -DNDEBUG
endif
LOCAL_CPP_EXTENSION := .cpp