[Buildroot] [PATCH 1/1] package/qt6/qt6base: add support for extra configure options

Dario Binacchi dario.binacchi at amarulasolutions.com
Wed Sep 10 13:48:22 UTC 2025


Following the same approach already used for qt5base, add a single
config entry to pass arbitrary qt6base options, which are appended
to the ones generated by Buildroot. This allows to reduce the qt6base
binary size without requiring every qt6base option to be mapped to
Buildroot.

Signed-off-by: Dario Binacchi <dario.binacchi at amarulasolutions.com>
---
 package/qt6/qt6base/Config.in  | 11 +++++++++++
 package/qt6/qt6base/qt6base.mk |  3 +++
 2 files changed, 14 insertions(+)

diff --git a/package/qt6/qt6base/Config.in b/package/qt6/qt6base/Config.in
index 7f3948ec27c6..6b48fd31facb 100644
--- a/package/qt6/qt6base/Config.in
+++ b/package/qt6/qt6base/Config.in
@@ -43,6 +43,17 @@ config BR2_PACKAGE_QT6BASE_GUI
 
 if BR2_PACKAGE_QT6BASE_GUI
 
+config BR2_PACKAGE_QT6BASE_CUSTOM_CONF_OPTS
+	string "Custom configuration options"
+	help
+	  Define custom qt6 configuration options which can be used to
+	  enable or disable options not managed by buildroot. These
+	  options are appended to the ones generated by buildroot and
+	  passed to qt6base during configuration.
+
+	  E.g. to disable mimetype handling, add the option
+	  -DQT_FEATURE_mimetype=OFF.
+
 config BR2_PACKAGE_QT6BASE_VULKAN
 	bool "Vulkan support"
 	depends on BR2_INSTALL_LIBSTDCPP # vulkan-loader
diff --git a/package/qt6/qt6base/qt6base.mk b/package/qt6/qt6base/qt6base.mk
index 51a4f1b5be7f..473fa7291ff0 100644
--- a/package/qt6/qt6base/qt6base.mk
+++ b/package/qt6/qt6base/qt6base.mk
@@ -426,6 +426,9 @@ else
 QT6BASE_CONF_OPTS += -DFEATURE_zstd=OFF
 endif
 
+# Must be last so can override all options set by Buildroot
+QT6BASE_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_QT6BASE_CUSTOM_CONF_OPTS))
+
 define QT6BASE_RM_USR_MKSPECS
 	$(Q)rm -rf $(TARGET_DIR)/usr/mkspecs
 endef
-- 
2.43.0



More information about the buildroot mailing list