Skip to content

Commit

Permalink
qmake renamed C macro
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Apr 23, 2024
1 parent c7eb8dd commit 236fe27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion drivers/common/common.pro
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ include($$TINYORM_SOURCE_TREE/qmake/common/common.pri)
# ---

DEFINES *= PROJECT_TINYDRIVERS
DEFINES *= TINY_QMAKE_BUILD
# Private defines
DEFINES *= TINY_QMAKE_BUILD_PRIVATE
# Used in common header files (currently in replacebindings.hpp only)
DEFINES *= PROJECT_TINYDRIVERS_PRIVATE

Expand Down
12 changes: 6 additions & 6 deletions drivers/common/src/orm/drivers/support/sqldriverfactory_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ namespace

return {
// qmake build doesn't support appending d after the basename for Debug builds
#if defined(TINYDRIVERS_DEBUG) && !defined(TINY_QMAKE_BUILD)
#if defined(TINYDRIVERS_DEBUG) && !defined(TINY_QMAKE_BUILD_PRIVATE)
driverBasenameVersion + 'd'_L1, // TinyMySql0d.dll
#endif
driverBasenameVersion, // TinyMySql0.dll
Expand All @@ -161,11 +161,11 @@ namespace

return {
// qmake build doesn't support appending d after the basename for Debug builds
#if defined(TINYDRIVERS_DEBUG) && !defined(TINY_QMAKE_BUILD)
#if defined(TINYDRIVERS_DEBUG) && !defined(TINY_QMAKE_BUILD_PRIVATE)
driverBasenameLib + 'd'_L1, // libTinyMySqld.so
#endif
driverBasenameLib, // libTinyMySql.so
#if defined(TINYDRIVERS_DEBUG) && !defined(TINY_QMAKE_BUILD)
#if defined(TINYDRIVERS_DEBUG) && !defined(TINY_QMAKE_BUILD_PRIVATE)
driverBasenameRaw + 'd'_L1, // TinyMySqld.so
#endif
/* As the last, try to load from the raw basename without any postfixes,
Expand All @@ -182,7 +182,7 @@ namespace
static const auto versionMajor = QString::number(TINYDRIVERS_VERSION_MAJOR);

// qmake build doesn't prepend lib for shared libraries on MSYS2
#ifdef TINY_QMAKE_BUILD
#ifdef TINY_QMAKE_BUILD_PRIVATE
static const auto driverBasename = driverBasenameRaw;
#else
static const auto driverBasename = u"lib"_s + driverBasenameRaw;
Expand All @@ -192,7 +192,7 @@ namespace

return {
// CMake builds only (or any other build system that prepends lib prefix)
#ifndef TINY_QMAKE_BUILD
#ifndef TINY_QMAKE_BUILD_PRIVATE
# ifdef TINYDRIVERS_DEBUG
driverBasenameVersion + 'd'_L1, // libTinyMySql0d.dll
# endif
Expand All @@ -201,7 +201,7 @@ namespace
#endif
// Also, try all other combinations without the lib prefix
// qmake build doesn't support appending d after the basename for Debug builds
#if defined(TINYDRIVERS_DEBUG) && !defined(TINY_QMAKE_BUILD)
#if defined(TINYDRIVERS_DEBUG) && !defined(TINY_QMAKE_BUILD_PRIVATE)
driverBasenameRawVersion + 'd'_L1,
#endif
driverBasenameRawVersion,
Expand Down

0 comments on commit 236fe27

Please sign in to comment.