File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,8 @@ LOCAL_SHARED_LIBRARIES := SDL2
1313
1414LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH ) /include
1515
16+ # https://developer.android.com/guide/practices/page-sizes
17+ LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
18+ LOCAL_LDFLAGS += "-Wl,-z,common-page-size=16384"
19+
1620include $(BUILD_SHARED_LIBRARY )
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ add_library(SDL2_net
8585)
8686
8787add_library (SDL2_net::${sdl2_net_export_name} ALIAS SDL2_net)
88+ sdl_add_platform_link_options(SDL2_net)
8889target_include_directories (SDL2_net
8990 PRIVATE
9091 "${CMAKE_CURRENT_LIST_DIR} /src"
@@ -291,14 +292,17 @@ if(SDL2NET_SAMPLES)
291292 add_executable (showinterfaces examples/showinterfaces.c)
292293 target_compile_definitions (showinterfaces PRIVATE SDL_MAIN_HANDLED)
293294 target_link_libraries (showinterfaces PRIVATE SDL2_net::${sdl2_net_export_name} ${sdl2_target_name} )
295+ sdl_add_platform_link_options(showinterfaces)
294296
295297 add_executable (chat examples/chat.c examples/chat.h)
296298 if (TARGET SDL2::SDL2main)
297299 target_link_libraries (chat PRIVATE SDL2::SDL2main)
298300 endif ()
299301 target_link_libraries (chat PRIVATE SDL2_net::${sdl2_net_export_name} SDL2::SDL2test ${sdl2_target_name} )
302+ sdl_add_platform_link_options(chat)
300303
301304 add_executable (chatd examples/chatd.c examples/chat.h)
302305 target_compile_definitions (chatd PRIVATE SDL_MAIN_HANDLED)
303306 target_link_libraries (chatd PRIVATE SDL2_net::${sdl2_net_export_name} ${sdl2_target_name} )
307+ sdl_add_platform_link_options(chatd)
304308endif ()
Original file line number Diff line number Diff line change @@ -287,3 +287,10 @@ function(sdl_target_link_options_no_undefined TARGET)
287287 endif ()
288288 endif ()
289289endfunction ()
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 ()
You can’t perform that action at this time.
0 commit comments