drivers qmake fixes and enhancements

This commit is contained in:
silverqx
2023-12-12 21:21:15 +01:00
parent 007c275aa3
commit 43b70d43ba
9 changed files with 58 additions and 21 deletions

View File

@@ -15,6 +15,8 @@ tinyMinRecQt = 5.15.2
# Make minimum toolchain version a requirement
load(tiny_toolchain_requirement)
# The staticlib option check
load(tiny_staticlib_check)
# Subprojects
# ---

View File

@@ -4,11 +4,6 @@ QT -= gui
TEMPLATE = lib
TARGET = TinyDrivers
# Variables to target the correct build folder
# ---
include($$TINYORM_SOURCE_TREE/qmake/support/variables.pri)
# Common for static/shared libraries
# ---
@@ -20,6 +15,11 @@ include($$TINYORM_SOURCE_TREE/qmake/common/libraries.pri)
DEFINES *= QT_ASCII_CAST_WARNINGS
DEFINES *= QT_NO_CAST_FROM_ASCII
# Variables to target the correct build folder
# ---
include($$TINYORM_SOURCE_TREE/qmake/support/variables.pri)
# TinyDrivers configuration
# ---
# It must be before the common/common.pri because of constants resolving
@@ -126,13 +126,6 @@ win32-msvc:CONFIG(debug, debug|release) {
load(tiny_system_includepath)
tiny_add_system_includepath($$quote($$TINYORM_SOURCE_TREE/include/))
build_loadable_drivers: \
tiny_is_building_driver(mysql): \
tiny_add_system_includepath( \
$$quote($$TINYORM_SOURCE_TREE/drivers/mysql/include/) \
$$quote($$TINYORM_SOURCE_TREE/drivers/mysql/include_private/) \
)
# Auto-configuration
# ---

View File

@@ -93,10 +93,8 @@ disable_tom: DEFINES *= TINYORM_DISABLE_TOM
load(tiny_system_includepath)
tiny_is_building_drivers(): \
tiny_add_system_includepath( \
$$quote($$TINYORM_SOURCE_TREE/drivers/common/include/) \
$$quote($$TINYORM_SOURCE_TREE/drivers/mysql/include/) \
)
tiny_add_system_includepath( \
$$quote($$TINYORM_SOURCE_TREE/drivers/common/include/))
tiny_add_system_includepath($$quote($$TINYORM_SOURCE_TREE/include/))

View File

@@ -1,2 +1,8 @@
load(tiny_drivers)
# Nothing to do, TinyDrivers doesn't use this CONFIG option
tiny_is_drivers_target(): \
return()
CONFIG *= disable_orm
DEFINES *= TINYORM_DISABLE_ORM

View File

@@ -1,2 +1,8 @@
load(tiny_drivers)
# Nothing to do, TinyDrivers doesn't use this CONFIG option
tiny_is_drivers_target(): \
return()
CONFIG *= disable_tom
DEFINES *= TINYORM_DISABLE_TOM

View File

@@ -121,10 +121,31 @@ defineTest(tiny_is_building_driver) {
}
# Check TinyDrivers build type CONFIG options.
defineTest(tiny_drivers_check_build_types): \
defineTest(tiny_drivers_check_build_types) {
!build_pass: \
if(build_shared_drivers:if(build_loadable_drivers|build_static_drivers)) | \
if(build_loadable_drivers:if(build_shared_drivers|build_static_drivers)) | \
if(build_static_drivers:if(build_shared_drivers|build_loadable_drivers)): \
error( "More TinyDrivers build types defined in the CONFIG options, only one of\
these 'build_shared/loadable/static_drivers' CONFIG options can be\
defined at a time." )
!build_pass: \
CONFIG(static, dll|shared|static|staticlib): \
if(build_shared_drivers|build_loadable_drivers): \
error( "The 'build_shared/loadable_drivers' TinyDrivers build types can't be used\
with the 'static' CONFIG option, please use the 'build_static_drivers'\
CONFIG option." )
}
# Determine whether the current TARGET is TinyDrivers-related.
defineTest(tiny_is_drivers_target) {
tiny_is_building_drivers(): \
if(equals(TARGET, TinyDrivers) | \
equals(TARGET, TinyMySql)): \
# equals(TARGET, TinyPostgres) | \
# equals(TARGET, TinySQLite)): \
return(true)
return(false)
}

View File

@@ -0,0 +1,7 @@
!build_pass: \
CONFIG(staticlib, dll|shared|static|staticlib): \
if(build_tests|tom_example|tiny_is_building_drivers()): \
error( "The 'staticlib' can't be used with executables, the build will fail because\
it will produce some executable, please use the CONFIG += static instead,\
if you want to build all libraries as static library archives and link\
against static libraries." )

View File

@@ -1,2 +1,8 @@
load(tiny_drivers)
# Nothing to do, TinyDrivers doesn't use this CONFIG option
tiny_is_drivers_target(): \
return()
CONFIG *= tom_example
DEFINES *= TINYORM_TOM_EXAMPLE

View File

@@ -119,10 +119,8 @@ unset(tinyRcIncludepath)
load(tiny_system_includepath)
tiny_is_building_drivers(): \
tiny_add_system_includepath( \
$$quote($$TINYORM_SOURCE_TREE/drivers/common/include/) \
$$quote($$TINYORM_SOURCE_TREE/drivers/mysql/include/) \
)
tiny_add_system_includepath( \
$$quote($$TINYORM_SOURCE_TREE/drivers/common/include/))
tiny_add_system_includepath( \
$$quote($$TINYORM_SOURCE_TREE/include/) \