@@ -89,9 +89,17 @@ if (NOT DEFINED HC_NOZLIB)
8989 "${PATH_TO_ROOT} /External/zlib/contrib/minizip"
9090 )
9191
92+ set (ZLIB_COMPILE_DEFINITIONS "HAVE_UNISTD_H" )
93+
94+ # ftello and fseeko become available on minSdkVersion >= 24
95+ if (ANDROID_PLATFORM_LEVEL LESS 24)
96+ list (APPEND ZLIB_COMPILE_DEFINITIONS "USE_FILE32API" )
97+ endif ()
98+
99+
92100 set_source_files_properties (
93- " ${PATH_TO_ROOT} /External/zlib/contrib/minizip/ioapi.c"
94- PROPERTIES COMPILE_DEFINITIONS "MINIZIP_FOPEN_NO_64=1 "
101+ ${ZLIB_SOURCE_FILES}
102+ PROPERTIES COMPILE_DEFINITIONS "${ZLIB_COMPILE_DEFINITIONS} "
95103 )
96104endif ()
97105
@@ -109,12 +117,7 @@ endif()
109117 )
110118
111119set (ANDROID_INCLUDE_DIRS
112- "${PATH_TO_ROOT} /External/opensslGeneratedHeaders/android"
113- )
114-
115- add_compile_options (
116- $<$<COMPILE_LANGUAGE:CXX>:-Wno-error=implicit-function-declaration>
117- $<$<COMPILE_LANGUAGE:C>:-Wno-error=implicit-function-declaration>
120+ "${PATH_TO_ROOT} /External/opensslGeneratedHeaders/android"
118121)
119122
120123#########################
@@ -136,6 +139,25 @@ target_include_directories(
136139 "${ZLIB_INCLUDE_DIRS} "
137140)
138141
142+ if (BUILD_SHARED_LIBS )
143+ target_link_libraries (
144+ "${PROJECT_NAME} "
145+ PRIVATE
146+ log
147+ # Following should be moved to target_link_options when available with cmake 3.13
148+ -Wl,--version -script,${CMAKE_CURRENT_SOURCE_DIR} /libHttpClient.Android.map.txt
149+ # This causes the linker to emit an error when a version script names a
150+ # symbol that is not found, rather than silently ignoring that line.
151+ -Wl,--no -undefined-version
152+ )
153+
154+ set_target_properties (
155+ "${PROJECT_NAME} "
156+ PROPERTIES
157+ LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR} /libHttpClient.Android.map.txt
158+ )
159+ endif ()
160+
139161include ("../libHttpClient.CMake/GetLibHCFlags.cmake" )
140162get_libhc_flags(FLAGS FLAGS_DEBUG FLAGS_RELEASE)
141163
0 commit comments