diff mbox series

[v4,20/29] package/qt6/qt6base: add support for sql module w/ sqlite

Message ID 20220826135503.20612-21-jesseevg@gmail.com
State Accepted
Headers show
Series Extend Qt6 configuration | expand

Commit Message

Jesse Van Gavere Aug. 26, 2022, 1:54 p.m. UTC
Signed-off-by: Jesse Van Gavere <jesseevg@gmail.com>
---
 package/qt6/qt6base/Config.in  | 25 +++++++++++++++++++++++++
 package/qt6/qt6base/qt6base.mk |  9 +++++++++
 2 files changed, 34 insertions(+)

Comments

Thomas Petazzoni Sept. 20, 2022, 6:39 a.m. UTC | #1
On Fri, 26 Aug 2022 15:54:54 +0200
Jesse Van Gavere <jesseevg@gmail.com> wrote:

> Signed-off-by: Jesse Van Gavere <jesseevg@gmail.com>
> ---
>  package/qt6/qt6base/Config.in  | 25 +++++++++++++++++++++++++
>  package/qt6/qt6base/qt6base.mk |  9 +++++++++
>  2 files changed, 34 insertions(+)
> 
> diff --git a/package/qt6/qt6base/Config.in b/package/qt6/qt6base/Config.in
> index 79b6d675c5..5ae11afdb1 100644
> --- a/package/qt6/qt6base/Config.in
> +++ b/package/qt6/qt6base/Config.in
> @@ -90,6 +90,31 @@ comment "PostgreSQL plugin needs a toolchain w/ wchar, dynamic library"
>  	depends on BR2_USE_MMU
>  	depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR
>  
> +choice
> +	prompt "SQLite 3 support"
> +	default BR2_PACKAGE_QT6BASE_SQLITE_NONE
> +	help
> +	  Select SQLite support.
> +
> +config BR2_PACKAGE_QT6BASE_SQLITE_NONE
> +	bool "No sqlite support"
> +	help
> +	  Do not compile any kind of SQLite support.
> +
> +config BR2_PACKAGE_QT6BASE_SQLITE_QT
> +	bool "Qt SQLite"
> +	help
> +	  Use Qt bundled SQLite support.
> +
> +config BR2_PACKAGE_QT6BASE_SQLITE_SYSTEM
> +	bool "System SQLite"
> +	select BR2_PACKAGE_SQLITE
> +	select BR2_PACKAGE_SQLITE_ENABLE_COLUMN_METADATA
> +	help
> +	  Use system SQLite.

In Buildroot, we really prefer to use non-bundled dependencies when it
is possible. So really the choice no/bundled/system does not make a lot
of sense. I have replaced it with a single boolean to enable/disable
sqlite support, and if enabled, it always uses the system sqlite.


> +ifeq ($(BR2_PACKAGE_QT6BASE_SQLITE_SYSTEM),y)
> +QT6BASE_CONF_OPTS += -DFEATURE_sql_sqlite=ON -DFEATURE_system_sqlite=ON
> +QT6BASE_DEPENDENCIES += sqlite
> +else ifeq ($(BR2_PACKAGE_QT6BASE_SQLITE_QT),y)
> +QT6BASE_CONF_OPTS += -DFEATURE_sql_sqlite=ON -DFEATURE_system_sqlite=OFF
> +else
> +QT6BASE_CONF_OPTS += -DFEATURE_sql_sqlite=OFF
> +endif

Consequently this has been simplified as well a little bit.

Applied with those changes. Thanks!

Best regards,

Thomas
diff mbox series

Patch

diff --git a/package/qt6/qt6base/Config.in b/package/qt6/qt6base/Config.in
index 79b6d675c5..5ae11afdb1 100644
--- a/package/qt6/qt6base/Config.in
+++ b/package/qt6/qt6base/Config.in
@@ -90,6 +90,31 @@  comment "PostgreSQL plugin needs a toolchain w/ wchar, dynamic library"
 	depends on BR2_USE_MMU
 	depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR
 
+choice
+	prompt "SQLite 3 support"
+	default BR2_PACKAGE_QT6BASE_SQLITE_NONE
+	help
+	  Select SQLite support.
+
+config BR2_PACKAGE_QT6BASE_SQLITE_NONE
+	bool "No sqlite support"
+	help
+	  Do not compile any kind of SQLite support.
+
+config BR2_PACKAGE_QT6BASE_SQLITE_QT
+	bool "Qt SQLite"
+	help
+	  Use Qt bundled SQLite support.
+
+config BR2_PACKAGE_QT6BASE_SQLITE_SYSTEM
+	bool "System SQLite"
+	select BR2_PACKAGE_SQLITE
+	select BR2_PACKAGE_SQLITE_ENABLE_COLUMN_METADATA
+	help
+	  Use system SQLite.
+
+endchoice
+
 endif
 
 config BR2_PACKAGE_QT6BASE_SYSLOG
diff --git a/package/qt6/qt6base/qt6base.mk b/package/qt6/qt6base/qt6base.mk
index 3925dee83b..e7c403b75a 100644
--- a/package/qt6/qt6base/qt6base.mk
+++ b/package/qt6/qt6base/qt6base.mk
@@ -122,6 +122,15 @@  else
 QT6BASE_CONF_OPTS += -DFEATURE_sql_psql=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_QT6BASE_SQLITE_SYSTEM),y)
+QT6BASE_CONF_OPTS += -DFEATURE_sql_sqlite=ON -DFEATURE_system_sqlite=ON
+QT6BASE_DEPENDENCIES += sqlite
+else ifeq ($(BR2_PACKAGE_QT6BASE_SQLITE_QT),y)
+QT6BASE_CONF_OPTS += -DFEATURE_sql_sqlite=ON -DFEATURE_system_sqlite=OFF
+else
+QT6BASE_CONF_OPTS += -DFEATURE_sql_sqlite=OFF
+endif
+
 else
 QT6BASE_CONF_OPTS += -DFEATURE_sql=OFF
 endif