Files
TinyORM/conf.pri.example
2023-04-02 13:26:31 +02:00

122 lines
3.5 KiB
Plaintext

# Tom migrations
# ---
# Default migrations path as the string for the make:migration command
# The path can be absolute or relative (to the pwd at runtime)
# It will look like this on the cmd. line: -DTINYTOM_MIGRATIONS_DIR="<path>/<path>"
# If the path doesn't contain a space then the \" is not needed
# Will be stringified in the tom/application.cpp
#DEFINES += TINYTOM_MIGRATIONS_DIR="\"database/migrations\""
# Default models path as the string for the make:model command
#DEFINES += TINYTOM_MODELS_DIR="\"database/models\""
# Default seeders path as the string for the make:seeder command
#DEFINES += TINYTOM_SEEDERS_DIR="\"database/seeders\""
# Dependencies include and library paths
# ---
# MySQL C library
# Arch - pacman -S mariadb-libs
# Gentoo - emerge dev-db/mysql (package.use: -server -perl)
# Ubuntu - apt install libmysqlclient-dev
# range-v3 library (header only)
# Arch - pacman -S range-v3
# Gentoo - emerge dev-cpp/range-v3
# Ubuntu - apt install librange-v3-dev
# ccache
# Arch - pacman -S ccache
# Gentoo - emerge dev-util/ccache
# Ubuntu - apt install ccache
# MinGW
win32-g++|win32-clang-g++ {
# Enable ccache wrapper
CONFIG *= tiny_ccache
# Includes
# tabulate
INCLUDEPATH += $$quote(C:/msys64/home/xyz/vcpkg/installed/x64-mingw-dynamic/include/)
QMAKE_CXXFLAGS += -isystem $$shell_quote(C:/msys64/home/xyz/vcpkg/installed/x64-mingw-dynamic/include/)
# Libraries
# MySQL C library
# Find with the pkg-config (preferred), shared build only
mysql_ping:!link_pkgconfig_off: \
!CONFIG(static, dll|shared|static|staticlib): \
!CONFIG(staticlib, dll|shared|static|staticlib) {
CONFIG *= link_pkgconfig
PKGCONFIG += libmariadb
}
# Static build
else:mysql_ping: \
!CONFIG(shared, dll|shared|static|staticlib): \
!CONFIG(dll, dll|shared|static|staticlib): \
LIBS += -lmariadb.dll
# Or add manually (use only one method, above or this manual method)
mysql_ping {
# For shared build
LIBS += -lmariadb
# For static build
LIBS += -lmariadb.dll
}
# Use faster linker
# CONFIG *= use_lld_linker does not work on MinGW
QMAKE_LFLAGS *= -fuse-ld=lld
}
else:win32-msvc|win32-clang-msvc {
# Enable ccache wrapper
# CONFIG *= tiny_ccache
# Includes
# range-v3
INCLUDEPATH += $$quote(E:/xyz/vcpkg/installed/x64-windows/include/)
# Conditional dependencies
# MySQL C library is used by TinyORM and it uses mysql_ping()
mysql_ping {
INCLUDEPATH += $$quote(C:/Program Files/MySQL/MySQL Server 8.0/include/)
LIBS += $$quote(-LC:/Program Files/MySQL/MySQL Server 8.0/lib/)
LIBS += -llibmysql
}
win32-clang-msvc: \
QMAKE_CXXFLAGS += \
-imsvc $$shell_quote(E:/xyz/vcpkg/installed/x64-windows/include/) \
-imsvc $$shell_quote(C:/Program Files/MySQL/MySQL Server 8.0/include/)
}
else:unix {
# Includes
# range-v3
QMAKE_CXXFLAGS += -isystem $$shell_quote(/home/xyz/vcpkg/installed/x64-linux/include/)
# Libraries
# MySQL C library
# Find with pkg-config (preferred)
mysql_ping:!link_pkgconfig_off {
CONFIG *= link_pkgconfig
# Pick only one
PKGCONFIG += mysqlclient
PKGCONFIG += libmariadb
}
# Or add manually (use only one)
mysql_ping {
# Pick only one
LIBS += -lmysqlclient
LIBS += -lmariadb
}
# Use faster linkers
clang: CONFIG *= use_lld_linker
else: CONFIG *= use_gold_linker
# Or use mold linker
# QMAKE_LFLAGS *= -fuse-ld=mold
}