Skip to content

Commit 1a2c7cb

Browse files
committed
Update sqlite3 from 3.13 to 3.19.3 (2017-06-08)
Fix SRombauts#125 Incompatibility in 3.19.0 using a new CMake variable SQLITE_USE_LEGACY_STRUCT
1 parent 078941c commit 1a2c7cb

File tree

5 files changed

+14761
-8352
lines changed

5 files changed

+14761
-8352
lines changed

CHANGELOG.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,7 @@ Version 2.0.0 - July 25 2016
9494
Remove Column::errmsg() method : use Database or Statement equivalents
9595
More unit tests, with code coverage status on the GitHub page
9696
Do not force MSVC to use static runtime if unit-tests are not build
97+
98+
Version 2.1.0 - July 18 2017
99+
Update SQLite3 from 3.13 to latest 3.19.3 (2017-06-08)
100+

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ if (SQLITE_ENABLE_ASSERT_HANDLER)
8989
add_definitions(-DSQLITECPP_ENABLE_ASSERT_HANDLER)
9090
endif (SQLITE_ENABLE_ASSERT_HANDLER)
9191

92+
option(SQLITE_USE_LEGACY_STRUCT "Fallback to forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)" OFF)
93+
if (SQLITE_USE_LEGACY_STRUCT)
94+
# Force forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)
95+
add_definitions(-DSQLITE_USE_LEGACY_STRUCT)
96+
endif (SQLITE_USE_LEGACY_STRUCT)
97+
9298

9399
## Build the C++ Wrapper ##
94100

@@ -185,6 +191,12 @@ install(EXPORT ${PROJECT_NAME}Config DESTINATION lib/cmake/${PROJECT_NAME})
185191

186192
## Build provided copy of SQLite3 C library ##
187193

194+
# TODO NOCOMMIT
195+
#find_package(sqlite3)
196+
#if(sqlite3_VERSION VERSION_LESS "3.19")
197+
# set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
198+
#endif()
199+
188200
option(SQLITECPP_INTERNAL_SQLITE "Add the internal SQLite3 source to the project." ON)
189201
if (SQLITECPP_INTERNAL_SQLITE)
190202
# build the SQLite3 C library (for ease of use/compatibility) versus Linux sqlite3-dev package

include/SQLiteCpp/Database.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@
1717
// Forward declarations to avoid inclusion of <sqlite3.h> in a header
1818
struct sqlite3;
1919
struct sqlite3_context;
20+
21+
#ifndef SQLITE_USE_LEGACY_STRUCT // Since SQLITE 3.19 (used by default since SQLiteCpp 2.1.0)
22+
typedef struct sqlite3_value sqlite3_value;
23+
#else // Before SQLite 3.19 (legacy struct forward declaration can be activated with CMake SQLITECPP_LEGACY_STRUCT var)
2024
struct Mem;
2125
typedef struct Mem sqlite3_value;
26+
#endif
2227

2328

2429
namespace SQLite

0 commit comments

Comments
 (0)