summaryrefslogtreecommitdiffstats
path: root/src/corelib/configure.cmake
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2019-12-13 21:19:26 +0100
committerLinus Jahn <lnj@kaidan.im>2020-07-31 15:05:24 +0200
commitc19bafc60c1c2e9a73cb3d212293462a1be4eb47 (patch)
tree089269cabcc8b75832a6ce3cff8ec5e4020b0de0 /src/corelib/configure.cmake
parent5d69aa3ee1214cf689e2357bff8688f2ff138471 (diff)
QtCore: Use system-wide libb2 if present
This adds the option to build Qt with libb2, which is especially recommended, if you care about the performance of the BLAKE2 hashing algorithms. The bundled version is the pure reference C implementation of BLAKE2, while libb2 has many additional hardware optimizations. However, the API of both is the same, so no changes to the code were necessary here. Change-Id: I3563982f4e07be300291fe103c38b16a404b3ebb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/corelib/configure.cmake')
-rw-r--r--src/corelib/configure.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake
index 7f565437cd..21a525bd03 100644
--- a/src/corelib/configure.cmake
+++ b/src/corelib/configure.cmake
@@ -6,6 +6,10 @@
set(INPUT_doubleconversion "undefined" CACHE STRING "")
set_property(CACHE INPUT_doubleconversion PROPERTY STRINGS undefined no qt system)
+# input libb2
+set(INPUT_libb2 "undefined" CACHE STRING "")
+set_property(CACHE INPUT_libb2 PROPERTY STRINGS undefined no qt system)
+
#### Libraries
@@ -18,6 +22,7 @@ if(QT_FEATURE_dlopen)
endif()
qt_find_package(Libsystemd PROVIDED_TARGETS PkgConfig::Libsystemd MODULE_NAME core QMAKE_LIB journald)
qt_find_package(WrapAtomic PROVIDED_TARGETS WrapAtomic::WrapAtomic MODULE_NAME core QMAKE_LIB libatomic)
+qt_find_package(Libb2 PROVIDED_TARGETS PkgConfig::Libb2 MODULE_NAME core QMAKE_LIB libb2)
qt_find_package(WrapRt PROVIDED_TARGETS WrapRt::WrapRt MODULE_NAME core QMAKE_LIB librt)
qt_find_package(LTTngUST PROVIDED_TARGETS LTTng::UST MODULE_NAME core QMAKE_LIB lttng-ust)
qt_add_qmake_lib_dependency(lttng-ust libdl)
@@ -607,6 +612,13 @@ qt_feature("journald" PRIVATE
AUTODETECT OFF
CONDITION Libsystemd_FOUND
)
+# Used by QCryptographicHash for the BLAKE2 hashing algorithms
+qt_feature("system-libb2" PRIVATE
+ LABEL "Using system libb2"
+ CONDITION Libb2_FOUND
+ ENABLE INPUT_libb2 STREQUAL 'system'
+ DISABLE INPUT_libb2 STREQUAL 'no' OR INPUT_libb2 STREQUAL 'qt'
+)
# Currently only used by QTemporaryFile; linkat() exists on Android, but hardlink creation fails due to security rules
qt_feature("linkat" PRIVATE
LABEL "linkat()"
@@ -956,6 +968,7 @@ qt_configure_add_summary_entry(ARGS "doubleconversion")
qt_configure_add_summary_entry(ARGS "system-doubleconversion")
qt_configure_add_summary_entry(ARGS "glib")
qt_configure_add_summary_entry(ARGS "icu")
+qt_configure_add_summary_entry(ARGS "system-libb2")
qt_configure_add_summary_entry(ARGS "mimetype-database")
qt_configure_add_summary_entry(
TYPE "firstAvailableFeature"