Commit 4c43158d authored by Sharaf Zaman's avatar Sharaf Zaman

Android: Add optional dependency giflib to the build

Maniphest: T10784
parent c296761a
......@@ -11,6 +11,19 @@ ExternalProject_Add(
UPDATE_COMMAND ""
)
elseif (ANDROID)
ExternalProject_Add(
ext_giflib
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/giflib-5.1.4.tar.bz2
URL_MD5 2c171ced93c0e83bb09e6ccad8e3ba2b
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/android-cmake.patch
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_giflib} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DBUILD_utils=OFF -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DANDROID_PLATFORM=${ANDROID_PLATFORM} -DANDROID_ABI=${ANDROID_ABI}
UPDATE_COMMAND ""
)
else()
ExternalProject_Add(
ext_giflib
......
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
+
+add_library (giflib SHARED
+ lib/dgif_lib.c
+ lib/egif_lib.c
+ lib/gifalloc.c
+ lib/gif_err.c
+ lib/gif_font.c
+ lib/gif_hash.c
+ lib/openbsd-reallocarray.c
+ lib/quantize.c
+)
+
+add_definitions (-DSIZE_MAX=0xffffffff -DS_IREAD=S_IRUSR -DS_IWRITE=S_IWUSR -DS_IEXEC=S_IXUSR)
+
+
+install (TARGETS giflib LIBRARY DESTINATION lib)
+install (FILES lib/gif_lib.h DESTINATION include)
+
......@@ -656,6 +656,8 @@ if (ANDROID)
set (TIFF_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/include})
set (FFTW3_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/i/lib/libfftw3.so)
set (FFTW3_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/)
set (GIF_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/i/lib/libgiflib.so)
set (GIF_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/include)
endif()
......@@ -704,6 +706,9 @@ set_package_properties(GIF PROPERTIES
URL "http://giflib.sourceforge.net/"
TYPE OPTIONAL
PURPOSE "Required by the Krita GIF filter")
if (GIF_FOUND)
list (APPEND ANDROID_EXTRA_LIBS ${GIF_LIBRARY})
endif()
find_package(HEIF "1.3.0")
set_package_properties(HEIF PROPERTIES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment