From 2bb8179ec111f75f3439a7ce4ff7dfcd1c41d9c4 Mon Sep 17 00:00:00 2001 From: chenqinggang001 <74290987+chenqinggang001@users.noreply.github.com> Date: Tue, 9 Sep 2025 13:54:31 +0800 Subject: [PATCH] Update CMakeLists.txt support Android 16kb page size Relevant documents https://developer.android.google.cn/guide/practices/page-sizes?hl=zh-cn --- cpp/inspireface/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpp/inspireface/CMakeLists.txt b/cpp/inspireface/CMakeLists.txt index 9ace78e6..bc044009 100644 --- a/cpp/inspireface/CMakeLists.txt +++ b/cpp/inspireface/CMakeLists.txt @@ -150,6 +150,10 @@ target_include_directories(InspireFace PUBLIC ) if (ANDROID) + target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-Wl,-z,max-page-size=16384") + if(ANDROID_NDK_MAJOR LESS_EQUAL 22) + target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-Wl,-z,common-page-size=16384") + endif() target_link_libraries(InspireFace PUBLIC ${LINK_THIRD_LIBS} jnigraphics log) set_target_properties(InspireFace PROPERTIES @@ -263,4 +267,4 @@ if (NOT IOS) endif() -endif() \ No newline at end of file +endif()