Skip to content

Commit 6463498

Browse files
committed
android: support Google Play 16 kiB page size requirement
Manual backport of 7ebec86
1 parent ebf1447 commit 6463498

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

Android.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ endif
163163

164164
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/include
165165

166+
# https://developer.android.com/guide/practices/page-sizes
167+
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
168+
LOCAL_LDFLAGS += "-Wl,-z,common-page-size=16384"
169+
166170
include $(BUILD_SHARED_LIBRARY)
167171

168172
###########################

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ add_library(SDL2_mixer
241241
src/utils.c
242242
)
243243
add_library(SDL2_mixer::${sdl2_mixer_export_name} ALIAS SDL2_mixer)
244+
sdl_add_platform_link_options(SDL2_mixer)
244245
target_include_directories(SDL2_mixer
245246
PUBLIC
246247
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
@@ -1015,6 +1016,7 @@ if(SDL2MIXER_SAMPLES)
10151016

10161017
foreach(prog playmus playwave)
10171018
# FIXME: mingw should be handled by SDL2::SDL2(-static) target
1019+
sdl_add_platform_link_options(${prog})
10181020
if(MINGW)
10191021
target_link_libraries(${prog} PRIVATE mingw32)
10201022
target_link_options(${prog} PRIVATE -mwindows)

cmake/PrivateSdlFunctions.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,10 @@ function(sdl_target_link_options_no_undefined TARGET)
287287
endif()
288288
endif()
289289
endfunction()
290+
291+
function(sdl_add_platform_link_options TARGET)
292+
if(ANDROID)
293+
target_link_options(${TARGET} PRIVATE "-Wl,-z,max-page-size=16384")
294+
target_link_options(${TARGET} PRIVATE "-Wl,-z,common-page-size=16384")
295+
endif()
296+
endfunction()

0 commit comments

Comments
 (0)