UI: SQLite: Add config.h

This commit is contained in:
Nodir Temirkhodjaev 2021-09-21 12:32:28 +03:00
parent 5e5058883e
commit bd535e94c7
5 changed files with 93 additions and 34 deletions

82
src/3rdparty/sqlite/config.h vendored Normal file
View File

@ -0,0 +1,82 @@
#pragma once
#include <string.h>
#if __has_include(<unistd.h>)
#include <unistd.h>
#endif
#if __has_include(<utime.h>)
#define HAVE_UTIME 1
#endif
#if (_XOPEN_SOURCE >= 500) && !(_POSIX_C_SOURCE >= 200809L) || _DEFAULT_SOURCE || _BSD_SOURCE
#define HAVE_USLEEP 1
#endif
#ifdef _GNU_SOURCE
#define HAVE_STRCHRNUL 1
#endif
#if _POSIX_C_SOURCE >= 199309L || _XOPEN_SOURCE >= 500
#define HAVE_FDATASYNC 1
#endif
#if _POSIX_C_SOURCE >= 1 || _BSD_SOURCE
#define HAVE_LOCALTIME_R 1
#else
#define HAVE_LOCALTIME_S 1
#endif
#define HAVE_MALLOC_USABLE_SIZE 1
#define HAVE_ISNAN 1
//#define SQLITE_ENABLE_FTS5 1
//#define SQLITE_ENABLE_JSON1 1
#define SQLITE_ENABLE_MEMORY_MANAGEMENT 1
//#define SQLITE_ENABLE_NULL_TRIM 1
//#define SQLITE_ENABLE_PREUPDATE_HOOK 1
//#define SQLITE_ENABLE_SESSION 1
#define SQLITE_ENABLE_STAT4 1
//#define SQLITE_ENABLE_UNLOCK_NOTIFY 1
#define SQLITE_DEFAULT_FOREIGN_KEYS 0
#define SQLITE_DEFAULT_LOCKING_MODE 0
#define SQLITE_DEFAULT_MEMSTATUS 0
#define SQLITE_DEFAULT_WAL_SYNCHRONOUS 1
#define SQLITE_ALLOW_COVERING_INDEX_SCAN 1
#define SQLITE_DQS 0
#define SQLITE_LIKE_DOESNT_MATCH_BLOBS 1
#define SQLITE_TEMP_STORE 2
#define SQLITE_THREADSAFE 1
#define SQLITE_USE_ALLOCA 1
#define SQLITE_DEFAULT_MMAP_SIZE 268435456
#define SQLITE_DEFAULT_CACHE_SIZE -100000
#define SQLITE_MAX_EXPR_DEPTH 0
#define SQLITE_MAX_WORKER_THREADS 1
#define SQLITE_WIN32_GETVERSIONEX 0
#define SQLITE_OMIT_AUTHORIZATION 1
#define SQLITE_OMIT_AUTOINIT 1
#define SQLITE_OMIT_AUTOMATIC_INDEX 1
#define SQLITE_OMIT_AUTORESET 1
#define SQLITE_OMIT_BLOB_LITERAL 1
#define SQLITE_OMIT_CAST 1
#define SQLITE_OMIT_CHECK 1
#define SQLITE_OMIT_COMPLETE 1
#define SQLITE_OMIT_DECLTYPE 1
#define SQLITE_OMIT_DEPRECATED 1
#define SQLITE_OMIT_EXPLAIN 1
#define SQLITE_OMIT_FOREIGN_KEY 1
#define SQLITE_OMIT_GET_TABLE 1
#define SQLITE_OMIT_INCRBLOB 1
#define SQLITE_OMIT_INTEGRITY_CHECK 1
#define SQLITE_OMIT_LOAD_EXTENSION 1
#define SQLITE_OMIT_PROGRESS_CALLBACK 1
#define SQLITE_OMIT_SHARED_CACHE 1
#define SQLITE_OMIT_TCL_VARIABLE 1
#define SQLITE_OMIT_TEMPDB 1
#define SQLITE_OMIT_TRACE 1
//#define SQLITE_OMIT_UTF16 1

4
src/3rdparty/sqlite/sqlite.h vendored Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "config.h"
#include "sqlite3.h"

View File

@ -1,42 +1,13 @@
CONFIG(release, debug|release) {
DEFINES *= NDEBUG
} else {
DEFINES += SQLITE_DEBUG
DEFINES += SQLITE_DEBUG SQLITE_ENABLE_API_ARMOR
}
DEFINES += \
SQLITE_THREADSAFE=1 \
SQLITE_DEFAULT_LOCKING_MODE=0 \
SQLITE_DEFAULT_MEMSTATUS=0 \
SQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
SQLITE_DQS=0 \
SQLITE_ENABLE_STAT4 \
SQLITE_LIKE_DOESNT_MATCH_BLOBS \
SQLITE_TEMP_STORE=2 \
SQLITE_USE_ALLOCA \
SQLITE_OMIT_AUTHORIZATION \
SQLITE_OMIT_AUTOINIT \
SQLITE_OMIT_AUTOMATIC_INDEX \
SQLITE_OMIT_BLOB_LITERAL \
SQLITE_OMIT_CAST \
SQLITE_OMIT_CHECK \
SQLITE_OMIT_COMPLETE \
SQLITE_OMIT_DECLTYPE \
SQLITE_OMIT_DEPRECATED \
SQLITE_OMIT_EXPLAIN \
SQLITE_OMIT_FOREIGN_KEY \
SQLITE_OMIT_GET_TABLE \
SQLITE_OMIT_INCRBLOB \
SQLITE_OMIT_INTEGRITY_CHECK \
SQLITE_OMIT_LOAD_EXTENSION \
SQLITE_OMIT_PROGRESS_CALLBACK \
SQLITE_OMIT_SHARED_CACHE \
SQLITE_OMIT_TCL_VARIABLE \
SQLITE_OMIT_TEMPDB \
SQLITE_OMIT_TRACE \
#SQLITE_OMIT_UTF16
DEFINES += _HAVE_SQLITE_CONFIG_H
SQLITE_DIR = $$PWD/../../../3rdparty/sqlite
INCLUDEPATH += $$SQLITE_DIR
SOURCES += \
@ -45,6 +16,8 @@ SOURCES += \
$$PWD/sqlitestmt.cpp
HEADERS += \
$$SQLITE_DIR/config.h \
$$SQLITE_DIR/sqlite.h \
$$SQLITE_DIR/sqlite3.h \
$$PWD/sqlitedb.h \
$$PWD/sqlitestmt.h

View File

@ -6,7 +6,7 @@
#include <QLoggingCategory>
#include <QSet>
#include <sqlite3.h>
#include <sqlite.h>
#include "sqlitestmt.h"

View File

@ -4,7 +4,7 @@
#include <QDataStream>
#include <QImage>
#include <sqlite3.h>
#include <sqlite.h>
SqliteStmt::SqliteStmt() = default;