Skip to content

Commit

Permalink
Make builds 16KB compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
aitorvs committed Dec 20, 2024
1 parent 2f20577 commit 81766df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion android/netguard/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ target_link_libraries( # Specifies the target library.
# included in the NDK.
${log-lib} )

#Ensure 16KB compatibility
target_link_options(netguard PRIVATE "-Wl,-z,max-page-size=16384")

# Makefile requires this to be with "/" to link correctly
file(TO_CMAKE_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} OUT_PATH_CMAKE)
add_custom_target(libwg-go.so WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/wireguard" COMMENT "Building wireguard-go" VERBATIM COMMAND make
Expand All @@ -73,7 +76,7 @@ add_custom_target(libwg-go.so WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../
ANDROID_PACKAGE_NAME=${ANDROID_PACKAGE_NAME}
GRADLE_USER_HOME=${GRADLE_USER_HOME}
CFLAGS=${CMAKE_C_FLAGS}\ -Wno-unused-command-line-argument
LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}\ -fuse-ld=gold
LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}\ -fuse-ld=gold\ -Wl,-z,max-page-size=16384
DESTDIR=${OUT_PATH_CMAKE}
BUILDDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../generated-src
)
Expand Down

0 comments on commit 81766df

Please sign in to comment.