Fix static build of Qt Creator

When is QTC_STATIC_BUILD set to ON add_qtc_library will add a
<target_name>_STATIC_LIBRARY define, otherwise <target_name>_LIBRARY is
added.

Since Sqlite uses two libraries now both SQLITE_STATIC_LIBRARY and
SQLITEC_STATIC_LIBRARY need to be checked.

Change-Id: I07c4de01627754534da7e37d1261db37779df296
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Cristian Adam
2023-01-04 21:48:34 +01:00
parent 4b237c0e98
commit be1c5cab96
5 changed files with 8 additions and 6 deletions

View File

@@ -27,7 +27,7 @@
#include <string.h>
#ifdef SQLITE_STATIC_LIBRARY
#if defined(SQLITE_STATIC_LIBRARY) || defined(SQLITEC_STATIC_LIBRARY)
#include "sqlite_static_config.h"
#endif

View File

@@ -195,7 +195,7 @@
#define sqlite3_stmt_status qtc_sqlite3_stmt_status
#define sqlite3_str_append qtc_sqlite3_str_append
#define sqlite3_str_appendall qtc_sqlite3_str_appendall
#define sqlite3_str_appendchar qtc_sqlite3_str_appendchastruct r
#define sqlite3_str_appendchar qtc_sqlite3_str_appendchar
#define sqlite3_str_appendf qtc_sqlite3_str_appendf
#define sqlite3_str_errcode qtc_sqlite3_str_errcode
#define sqlite3_str_finish qtc_sqlite3_str_finish

View File

@@ -2,6 +2,9 @@ add_qtc_library(SqliteC OBJECT
PROPERTIES AUTOMOC OFF AUTOUIC OFF QT_COMPILE_OPTIONS_DISABLE_WARNINGS ON POSITION_INDEPENDENT_CODE ON
CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.2.0
DEFINES SQLITE_CORE SQLITE_CUSTOM_INCLUDE=config.h $<$<CONFIG:Debug>:SQLITE_DEBUG>
PROPERTIES COMPILE_OPTIONS $<IF:$<CXX_COMPILER_ID:MSVC>,/FIconfig.h,-includeconfig.h>
PUBLIC_INCLUDES
../3rdparty/sqlite
SOURCES
../3rdparty/sqlite
../3rdparty/sqlite/sqlite3.c
@@ -18,8 +21,7 @@ add_qtc_library(Sqlite
CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.2.0
PUBLIC_INCLUDES
"${CMAKE_CURRENT_LIST_DIR}"
../3rdparty/sqlite
DEFINES SQLITE_LIBRARY SQLITE_CUSTOM_INCLUDE=config.h $<$<CONFIG:Debug>:SQLITE_REVERSE>
DEFINES SQLITE_CUSTOM_INCLUDE=config.h $<$<CONFIG:Debug>:SQLITE_REVERSE>
SOURCES
constraints.h
createtablesqlstatementbuilder.h

View File

@@ -3,7 +3,7 @@
#pragma once
#ifdef SQLITE_STATIC_LIBRARY
#if defined(SQLITE_STATIC_LIBRARY) || defined(SQLITEC_STATIC_LIBRARY)
using sqlite3 = struct qtc_sqlite3;
using sqlite3_stmt = struct qtc_sqlite3_stmt;
using sqlite3_session = struct qtc_sqlite3_session;

View File

@@ -40,7 +40,7 @@ public:
void close();
void closeWithoutException();
struct sqlite3 *sqliteDatabaseHandle() const;
sqlite3 *sqliteDatabaseHandle() const;
void setJournalMode(JournalMode journalMode);
JournalMode journalMode();