summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-04-15 16:41:02 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-04-16 16:49:28 +0200
commitf4417bf7e8f843438345f496cf5d6a9b6fa33709 (patch)
tree502ea3d41257505a9c899ebab75d13ab9a97cfcf /src
parent5656a60dd067a69f9e864a33068ec300124d4e05 (diff)
Check whether CMake was built with zstd support
CMake 3.18 introduced the file(ARCHIVE_CREATE) API that we use with COMPRESSION Zstd for compressing corelib's mimedatabase. It's possible to build CMake without proper zstd support, and we have encountered such builds in the wild where the file(ARCHIVE_CREATE) call crashes. Add a configure test to determine whether CMake properly supports the Zstd compression method. Fixes: QTBUG-89108 Change-Id: I37e389c878845162b6f18457984d4f73a265b604 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index 2af8854798..3c6b20636a 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -1187,6 +1187,11 @@ if(QT_FEATURE_mimetype AND QT_FEATURE_mimetype_database)
)
else()
if(QT_FEATURE_zstd)
+ if(NOT QT_CMAKE_ZSTD_SUPPORT)
+ message(FATAL_ERROR
+ "CMake was not built with zstd support. "
+ "Rebuild CMake or set QT_AVOID_CMAKE_ARCHIVING_API=ON.")
+ endif()
set(qmime_db_compression Zstd)
string(APPEND qmime_db_content "#define MIME_DATABASE_IS_ZSTD\n")
else()