make sql drivers independently configurable

our binary packages come without many sql drivers, because they have
proprietary dependencies we cannot ship. not every user wants to build
all of qt from scratch, so it makes sense to make it possible to
"enrich" the existing installation by compiling just the drivers. to
enable this, the drivers' configuration must be independent. but note
that it's still not possible to configure a single driver - the entire
sqldrivers directory is configured at once.

a side effect of this is that the availability of the sql plugins
cannot be made known with publicFeatures any more, because there is no
associated module pri file to put that information into. that should be
made inconsequential by making qtHaveModule() work for plugins.

Task-number: QTBUG-58372
Change-Id: Ibdebe3199688a57f93cea82dc15623081d1280f5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Oswald Buddenhagen 2017-05-10 18:55:06 +02:00
parent 78731b434e
commit ed07bdcb5f
7 changed files with 45 additions and 18 deletions

View File

@ -10,11 +10,11 @@
"subconfigs": [
"src/corelib",
"src/network",
"src/sql",
"src/gui",
"src/xml",
"src/widgets",
"src/printsupport"
"src/printsupport",
"src/plugins/sqldrivers"
],
"commandline": {

View File

@ -0,0 +1,19 @@
# This file detaches this sub-tree from the rest of qtbase,
# so it can be configured stand-alone.
# Of course, under normal circumstances, this _is_ part of qtbase,
# so we have to make some contortions to restore normality.
isEmpty(_QMAKE_CONF_): return() # Pre-scan during spec loading.
SQLDRV_SRC_TREE = $$dirname(_QMAKE_CONF_)
QTBASE_SRC_TREE = $$section(SQLDRV_SRC_TREE, /, 0, -4)
QTBASE_BLD_TREE = $$shadowed($$QTBASE_SRC_TREE)
!isEmpty(QTBASE_BLD_TREE):exists($$QTBASE_BLD_TREE/.qmake.cache) {
# This tricks qt_build_config.prf and qt_build_paths.prf
_QMAKE_CONF_ = $$QTBASE_SRC_TREE/.qmake.conf
} else {
CONFIG += sqldrivers_standalone
}
include($$QTBASE_SRC_TREE/.qmake.conf)

View File

@ -1,9 +1,9 @@
{
"module": "sql",
"module": "sqldrivers",
"depends": [
"core"
],
"testDir": "../../config.tests",
"testDir": "../../../config.tests",
"commandline": {
"assignments": {
@ -129,42 +129,42 @@
"sql-db2": {
"label": "DB2 (IBM)",
"condition": "libs.db2",
"output": [ "publicFeature" ]
"output": [ "privateFeature" ]
},
"sql-ibase": {
"label": "InterBase",
"condition": "libs.ibase",
"output": [ "publicFeature" ]
"output": [ "privateFeature" ]
},
"sql-mysql": {
"label": "MySql",
"condition": "libs.mysql",
"output": [ "publicFeature" ]
"output": [ "privateFeature" ]
},
"sql-oci": {
"label": "OCI (Oracle)",
"condition": "libs.oci",
"output": [ "publicFeature" ]
"output": [ "privateFeature" ]
},
"sql-odbc": {
"label": "ODBC",
"condition": "libs.odbc && features.datestring",
"output": [ "publicFeature" ]
"condition": "features.datestring && libs.odbc",
"output": [ "privateFeature" ]
},
"sql-psql": {
"label": "PostgreSQL",
"condition": "libs.psql",
"output": [ "publicFeature" ]
"output": [ "privateFeature" ]
},
"sql-sqlite2": {
"label": "SQLite2",
"condition": "libs.sqlite2",
"output": [ "publicFeature" ]
"output": [ "privateFeature" ]
},
"sql-sqlite": {
"label": "SQLite",
"condition": "features.datestring",
"output": [ "publicFeature" ]
"output": [ "privateFeature" ]
},
"system-sqlite": {
"label": " Using system provided SQLite",
@ -174,8 +174,8 @@
},
"sql-tds": {
"label": "TDS (Sybase)",
"condition": "libs.tds && features.datestring",
"output": [ "publicFeature" ]
"condition": "features.datestring && libs.tds",
"output": [ "privateFeature" ]
}
},

View File

@ -1,5 +1,8 @@
QT = core core-private sql-private
# For QMAKE_USE in the parent projects.
include($$shadowed($$PWD)/qtsqldrivers-config.pri)
PLUGIN_TYPE = sqldrivers
load(qt_plugin)

View File

@ -1,5 +1,9 @@
TEMPLATE = subdirs
QT_FOR_CONFIG += sql
sqldrivers_standalone {
_QMAKE_CACHE_ = $$shadowed($$SQLDRV_SRC_TREE)/.qmake.conf
load(qt_configure)
}
qtConfig(sql-psql) : SUBDIRS += psql
qtConfig(sql-mysql) : SUBDIRS += mysql

View File

@ -1,10 +1,11 @@
TARGET = qsqlite
QT_FOR_CONFIG += sql-private
HEADERS += $$PWD/qsql_sqlite_p.h
SOURCES += $$PWD/qsql_sqlite.cpp $$PWD/smain.cpp
include($$OUT_PWD/../qtsqldrivers-config.pri)
QT_FOR_CONFIG += sqldrivers-private
qtConfig(system-sqlite) {
QMAKE_USE += sqlite
} else {