Commit 344855bb authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

JpegXL support: sync git/master with qt5-maintenance branch

CCBUGS: 436533
parent 597f0d5c
......@@ -130,6 +130,7 @@ add_subdirectory(ext_libgphoto2)
add_subdirectory(ext_libass)
add_subdirectory(ext_libicu)
add_subdirectory(ext_liblqr)
add_subdirectory(ext_libjxl)
add_subdirectory(ext_sane)
add_subdirectory(ext_exiv2)
add_subdirectory(ext_boost)
......
# Script to build jpegXL library for digiKam bundle.
#
# Copyright (c) 2015-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
set(PREFIX_ext_libjxl "${EXTPREFIX}")
set(JpegXL_Conf -DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=OFF
)
JoinListAsString("${JpegXL_Conf}" " " BASH_OPTIONS)
if(MINGW)
ExternalProject_Add(ext_libjxl
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
GIT_REPOSITORY https://github.com/libjxl/libjxl.git
GIT_TAG v0.6.1
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/jxl-lib-mxe.patch
CONFIGURE_COMMAND git submodule update --init --recursive --depth 1 --recommend-shallow &&
cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.mxe <SOURCE_DIR>/. &&
<SOURCE_DIR>/bootstrap.mxe ${MXE_BUILDROOT} RelWithDebInfo ${BASH_OPTIONS}
BUILD_COMMAND cd <SOURCE_DIR>/build.mxe && $(MAKE) -j
INSTALL_COMMAND cd <SOURCE_DIR>/build.mxe && $(MAKE) install/fast &&
cp -f <SOURCE_DIR>/build.mxe/third_party/brotli/libbrotlicommon.dll ${PREFIX_ext_libjxl}/bin &&
cp -f <SOURCE_DIR>/build.mxe/third_party/brotli/libbrotlidec.dll ${PREFIX_ext_libjxl}/bin &&
cp -f <SOURCE_DIR>/build.mxe/third_party/brotli/libbrotlienc.dll ${PREFIX_ext_libjxl}/bin &&
mv -f ${PREFIX_ext_libjxl}/lib/libjxl.dll ${PREFIX_ext_libjxl}/bin &&
mv -f ${PREFIX_ext_libjxl}/lib/libjxl_threads.dll ${PREFIX_ext_libjxl}/bin
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
ALWAYS 0
)
elseif(APPLE)
ExternalProject_Add(ext_libjxl
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
# To use official release tarball
GIT_REPOSITORY https://github.com/libjxl/libjxl.git
GIT_TAG v0.6.1
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/jxl-lib-macports.patch
CONFIGURE_COMMAND git submodule update --init --recursive --depth 1 --recommend-shallow &&
cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.macports <SOURCE_DIR>/. &&
<SOURCE_DIR>/bootstrap.macports ${PREFIX_ext_libjxl} RelWithDebInfo x86_64 ${BASH_OPTIONS}
BUILD_COMMAND cd <SOURCE_DIR>/build && $(MAKE)
INSTALL_COMMAND cd <SOURCE_DIR>/build && $(MAKE) install/fast
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
ALWAYS 0
)
else() # Linux
ExternalProject_Add(ext_libjxl
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
GIT_REPOSITORY https://github.com/libjxl/libjxl.git
GIT_TAG v0.6.1
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/jxl-lib-linux.patch
CONFIGURE_COMMAND git submodule update --init --recursive --depth 1 --recommend-shallow &&
$(CMAKE_COMMAND) . -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_libjxl}
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
-DICONV_INCLUDE_DIR=${PREFIX_ext_libjxl}/include
${JpegXL_Conf}
${GLOBAL_PROFILE}
BUILD_COMMAND cd <SOURCE_DIR> && $(MAKE)
INSTALL_COMMAND cd <SOURCE_DIR> && $(MAKE) install/fast
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
ALWAYS 0
)
endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2790ab..003dee8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,23 +71,23 @@ endif()
set(WARNINGS_AS_ERRORS_DEFAULT false)
-set(JPEGXL_ENABLE_FUZZERS ${ENABLE_FUZZERS_DEFAULT} CACHE BOOL
+set(JPEGXL_ENABLE_FUZZERS false CACHE BOOL
"Build JPEGXL fuzzer targets.")
set(JPEGXL_ENABLE_DEVTOOLS false CACHE BOOL
"Build JPEGXL developer tools.")
-set(JPEGXL_ENABLE_TOOLS true CACHE BOOL
+set(JPEGXL_ENABLE_TOOLS false CACHE BOOL
"Build JPEGXL user tools: cjxl and djxl.")
-set(JPEGXL_ENABLE_MANPAGES true CACHE BOOL
+set(JPEGXL_ENABLE_MANPAGES false CACHE BOOL
"Build and install man pages for the command-line tools.")
-set(JPEGXL_ENABLE_BENCHMARK true CACHE BOOL
+set(JPEGXL_ENABLE_BENCHMARK false CACHE BOOL
"Build JPEGXL benchmark tools.")
-set(JPEGXL_ENABLE_EXAMPLES true CACHE BOOL
+set(JPEGXL_ENABLE_EXAMPLES false CACHE BOOL
"Build JPEGXL library usage examples.")
-set(JPEGXL_ENABLE_JNI true CACHE BOOL
+set(JPEGXL_ENABLE_JNI false CACHE BOOL
"Build JPEGXL JNI Java wrapper, if Java dependencies are installed.")
-set(JPEGXL_ENABLE_SJPEG true CACHE BOOL
+set(JPEGXL_ENABLE_SJPEG false CACHE BOOL
"Build JPEGXL with support for encoding with sjpeg.")
-set(JPEGXL_ENABLE_OPENEXR true CACHE BOOL
+set(JPEGXL_ENABLE_OPENEXR false CACHE BOOL
"Build JPEGXL with support for OpenEXR if available.")
set(JPEGXL_ENABLE_SKCMS true CACHE BOOL
"Build with skcms instead of lcms2.")
@@ -95,7 +95,7 @@ set(JPEGXL_BUNDLE_SKCMS true CACHE BOOL
"When building with skcms, bundle it into libjxl.a.")
set(JPEGXL_ENABLE_VIEWERS false CACHE BOOL
"Build JPEGXL viewer tools for evaluation.")
-set(JPEGXL_ENABLE_TCMALLOC ${ENABLE_TCMALLOC_DEFAULT} CACHE BOOL
+set(JPEGXL_ENABLE_TCMALLOC false CACHE BOOL
"Build JPEGXL using gperftools (tcmalloc) allocator.")
set(JPEGXL_ENABLE_PLUGINS false CACHE BOOL
"Build third-party plugings to support JPEG XL in other applications.")
@@ -109,7 +109,7 @@ set(JPEGXL_ENABLE_TRANSCODE_JPEG true CACHE BOOL
(default enabled)")
set(JPEGXL_STATIC false CACHE BOOL
"Build tools as static binaries.")
-set(JPEGXL_WARNINGS_AS_ERRORS ${WARNINGS_AS_ERRORS_DEFAULT} CACHE BOOL
+set(JPEGXL_WARNINGS_AS_ERRORS false CACHE BOOL
"Treat warnings as errors during compilation.")
set(JPEGXL_DEP_LICENSE_DIR "" CACHE STRING
"Directory where to search for system dependencies \"copyright\" files.")
@@ -382,4 +382,4 @@ add_subdirectory(plugins)
endif ()
# Binary tools
-add_subdirectory(tools)
+#add_subdirectory(tools)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2790ab..003dee8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,23 +71,23 @@ endif()
set(WARNINGS_AS_ERRORS_DEFAULT false)
-set(JPEGXL_ENABLE_FUZZERS ${ENABLE_FUZZERS_DEFAULT} CACHE BOOL
+set(JPEGXL_ENABLE_FUZZERS false CACHE BOOL
"Build JPEGXL fuzzer targets.")
set(JPEGXL_ENABLE_DEVTOOLS false CACHE BOOL
"Build JPEGXL developer tools.")
-set(JPEGXL_ENABLE_TOOLS true CACHE BOOL
+set(JPEGXL_ENABLE_TOOLS false CACHE BOOL
"Build JPEGXL user tools: cjxl and djxl.")
-set(JPEGXL_ENABLE_MANPAGES true CACHE BOOL
+set(JPEGXL_ENABLE_MANPAGES false CACHE BOOL
"Build and install man pages for the command-line tools.")
-set(JPEGXL_ENABLE_BENCHMARK true CACHE BOOL
+set(JPEGXL_ENABLE_BENCHMARK false CACHE BOOL
"Build JPEGXL benchmark tools.")
-set(JPEGXL_ENABLE_EXAMPLES true CACHE BOOL
+set(JPEGXL_ENABLE_EXAMPLES false CACHE BOOL
"Build JPEGXL library usage examples.")
-set(JPEGXL_ENABLE_JNI true CACHE BOOL
+set(JPEGXL_ENABLE_JNI false CACHE BOOL
"Build JPEGXL JNI Java wrapper, if Java dependencies are installed.")
-set(JPEGXL_ENABLE_SJPEG true CACHE BOOL
+set(JPEGXL_ENABLE_SJPEG false CACHE BOOL
"Build JPEGXL with support for encoding with sjpeg.")
-set(JPEGXL_ENABLE_OPENEXR true CACHE BOOL
+set(JPEGXL_ENABLE_OPENEXR false CACHE BOOL
"Build JPEGXL with support for OpenEXR if available.")
set(JPEGXL_ENABLE_SKCMS true CACHE BOOL
"Build with skcms instead of lcms2.")
@@ -95,7 +95,7 @@ set(JPEGXL_BUNDLE_SKCMS true CACHE BOOL
"When building with skcms, bundle it into libjxl.a.")
set(JPEGXL_ENABLE_VIEWERS false CACHE BOOL
"Build JPEGXL viewer tools for evaluation.")
-set(JPEGXL_ENABLE_TCMALLOC ${ENABLE_TCMALLOC_DEFAULT} CACHE BOOL
+set(JPEGXL_ENABLE_TCMALLOC false CACHE BOOL
"Build JPEGXL using gperftools (tcmalloc) allocator.")
set(JPEGXL_ENABLE_PLUGINS false CACHE BOOL
"Build third-party plugings to support JPEG XL in other applications.")
@@ -109,7 +109,7 @@ set(JPEGXL_ENABLE_TRANSCODE_JPEG true CACHE BOOL
(default enabled)")
set(JPEGXL_STATIC false CACHE BOOL
"Build tools as static binaries.")
-set(JPEGXL_WARNINGS_AS_ERRORS ${WARNINGS_AS_ERRORS_DEFAULT} CACHE BOOL
+set(JPEGXL_WARNINGS_AS_ERRORS false CACHE BOOL
"Treat warnings as errors during compilation.")
set(JPEGXL_DEP_LICENSE_DIR "" CACHE STRING
"Directory where to search for system dependencies \"copyright\" files.")
@@ -382,4 +382,4 @@ add_subdirectory(plugins)
endif ()
# Binary tools
-add_subdirectory(tools)
+#add_subdirectory(tools)
diff --git a/lib/jxl.cmake b/lib/jxl.cmake
index c0290ab..239cc9f 100644
--- a/lib/jxl.cmake
+++ b/lib/jxl.cmake
@@ -541,8 +541,10 @@ foreach(target IN ITEMS jxl jxl_dec)
# This hides the default visibility symbols from static libraries bundled into
# the shared library. In particular this prevents exposing symbols from hwy
# and skcms in the shared library.
+ if(NOT APPLE)
set_property(TARGET ${target} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,--exclude-libs=ALL")
+ endif()
endforeach()
# Only install libjxl shared library. The libjxl_dec is not installed since it
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2790ab..003dee8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,23 +71,23 @@ endif()
set(WARNINGS_AS_ERRORS_DEFAULT false)
-set(JPEGXL_ENABLE_FUZZERS ${ENABLE_FUZZERS_DEFAULT} CACHE BOOL
+set(JPEGXL_ENABLE_FUZZERS false CACHE BOOL
"Build JPEGXL fuzzer targets.")
set(JPEGXL_ENABLE_DEVTOOLS false CACHE BOOL
"Build JPEGXL developer tools.")
-set(JPEGXL_ENABLE_TOOLS true CACHE BOOL
+set(JPEGXL_ENABLE_TOOLS false CACHE BOOL
"Build JPEGXL user tools: cjxl and djxl.")
-set(JPEGXL_ENABLE_MANPAGES true CACHE BOOL
+set(JPEGXL_ENABLE_MANPAGES false CACHE BOOL
"Build and install man pages for the command-line tools.")
-set(JPEGXL_ENABLE_BENCHMARK true CACHE BOOL
+set(JPEGXL_ENABLE_BENCHMARK false CACHE BOOL
"Build JPEGXL benchmark tools.")
-set(JPEGXL_ENABLE_EXAMPLES true CACHE BOOL
+set(JPEGXL_ENABLE_EXAMPLES false CACHE BOOL
"Build JPEGXL library usage examples.")
-set(JPEGXL_ENABLE_JNI true CACHE BOOL
+set(JPEGXL_ENABLE_JNI false CACHE BOOL
"Build JPEGXL JNI Java wrapper, if Java dependencies are installed.")
-set(JPEGXL_ENABLE_SJPEG true CACHE BOOL
+set(JPEGXL_ENABLE_SJPEG false CACHE BOOL
"Build JPEGXL with support for encoding with sjpeg.")
-set(JPEGXL_ENABLE_OPENEXR true CACHE BOOL
+set(JPEGXL_ENABLE_OPENEXR false CACHE BOOL
"Build JPEGXL with support for OpenEXR if available.")
set(JPEGXL_ENABLE_SKCMS true CACHE BOOL
"Build with skcms instead of lcms2.")
@@ -95,7 +95,7 @@ set(JPEGXL_BUNDLE_SKCMS true CACHE BOOL
"When building with skcms, bundle it into libjxl.a.")
set(JPEGXL_ENABLE_VIEWERS false CACHE BOOL
"Build JPEGXL viewer tools for evaluation.")
-set(JPEGXL_ENABLE_TCMALLOC ${ENABLE_TCMALLOC_DEFAULT} CACHE BOOL
+set(JPEGXL_ENABLE_TCMALLOC false CACHE BOOL
"Build JPEGXL using gperftools (tcmalloc) allocator.")
set(JPEGXL_ENABLE_PLUGINS false CACHE BOOL
"Build third-party plugings to support JPEG XL in other applications.")
@@ -109,7 +109,7 @@ set(JPEGXL_ENABLE_TRANSCODE_JPEG true CACHE BOOL
(default enabled)")
set(JPEGXL_STATIC false CACHE BOOL
"Build tools as static binaries.")
-set(JPEGXL_WARNINGS_AS_ERRORS ${WARNINGS_AS_ERRORS_DEFAULT} CACHE BOOL
+set(JPEGXL_WARNINGS_AS_ERRORS false CACHE BOOL
"Treat warnings as errors during compilation.")
set(JPEGXL_DEP_LICENSE_DIR "" CACHE STRING
"Directory where to search for system dependencies \"copyright\" files.")
@@ -382,4 +382,4 @@ add_subdirectory(plugins)
endif ()
# Binary tools
-add_subdirectory(tools)
+#add_subdirectory(tools)
......@@ -295,6 +295,7 @@ rm -fr /usr/local/include/openssl || true
/opt/cmake/bin/cmake --build . --config RelWithDebInfo --target ext_opencv -- -j$CPU_CORES
/opt/cmake/bin/cmake --build . --config RelWithDebInfo --target ext_heif -- -j$CPU_CORES
/opt/cmake/bin/cmake --build . --config RelWithDebInfo --target ext_libjxl -- -j$CPU_CORES
#################################################################################################
......
......@@ -361,6 +361,7 @@ if [[ $DK_QTWEBENGINE = 0 ]] ; then
fi
cmake --build . --config RelWithDebInfo --target ext_opencv -- -j$CPU_CORES
cmake --build . --config RelWithDebInfo --target ext_libjxl -- -j$CPU_CORES
#################################################################################################
......
......@@ -192,6 +192,7 @@ ${MXE_BUILD_TARGETS}-cmake $ORIG_WD/../3rdparty \
${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_opencv -- -j$CPU_CORES
${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_heif -- -j$CPU_CORES
${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_libjxl -- -j$CPU_CORES
${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_drmingw -- -j$CPU_CORES
#################################################################################################
......
Supports Markdown
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