mirror of
https://github.com/silverqx/TinyORM.git
synced 2025-12-20 18:09:30 -06:00
drivers qmake fixes and enhancements
This commit is contained in:
@@ -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
|
||||
# ---
|
||||
|
||||
@@ -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
|
||||
# ---
|
||||
|
||||
|
||||
@@ -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/))
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
7
qmake/features/tiny_staticlib_check.prf
Normal file
7
qmake/features/tiny_staticlib_check.prf
Normal 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." )
|
||||
@@ -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
|
||||
|
||||
@@ -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/) \
|
||||
|
||||
Reference in New Issue
Block a user