Skip to content

Commit ca49ea4

Browse files
authored
Merge pull request #1 from olliwang/hunter-5083bef
Fixes build failure on modern Android NDKs (r23+).
2 parents 1fa2fb3 + 0cd04db commit ca49ea4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
6565
set(targets_export_name "${PROJECT_NAME}Targets")
6666
set(namespace "${PROJECT_NAME}::")
6767

68+
# Workaround for minizip build failure on modern NDKs (r23+).
69+
# Define USE_FILE32API to force a fallback from the missing ftello()/fseeko()
70+
# to the standard ftell()/fseek(), resolving the compile error. This may
71+
# limit support for files > 2GB on 32-bit systems.
72+
if(ANDROID AND CMAKE_C_COMPILER_ID MATCHES "Clang")
73+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_FILE32API" CACHE STRING "C compiler flags" FORCE)
74+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_FILE32API" CACHE STRING "C++ compiler flags" FORCE)
75+
endif()
76+
6877
option(USE_AES "enables building of aes library" ON)
6978
if(USE_AES)
7079
set(AES_SRC

0 commit comments

Comments
 (0)