Skip to content

Commit

Permalink
Update sqlite3 from 3.13 to 3.19.3 (2017-06-08)
Browse files Browse the repository at this point in the history
Fix #125 Incompatibility in 3.19.0 using a new CMake variable SQLITE_USE_LEGACY_STRUCT
  • Loading branch information
SRombauts committed Jul 18, 2017
1 parent 078941c commit 1a2c7cb
Show file tree
Hide file tree
Showing 5 changed files with 14,761 additions and 8,352 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Expand Up @@ -94,3 +94,7 @@ Version 2.0.0 - July 25 2016
Remove Column::errmsg() method : use Database or Statement equivalents
More unit tests, with code coverage status on the GitHub page
Do not force MSVC to use static runtime if unit-tests are not build

Version 2.1.0 - July 18 2017
Update SQLite3 from 3.13 to latest 3.19.3 (2017-06-08)

12 changes: 12 additions & 0 deletions CMakeLists.txt
Expand Up @@ -89,6 +89,12 @@ if (SQLITE_ENABLE_ASSERT_HANDLER)
add_definitions(-DSQLITECPP_ENABLE_ASSERT_HANDLER)
endif (SQLITE_ENABLE_ASSERT_HANDLER)

option(SQLITE_USE_LEGACY_STRUCT "Fallback to forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)" OFF)
if (SQLITE_USE_LEGACY_STRUCT)
# Force forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)
add_definitions(-DSQLITE_USE_LEGACY_STRUCT)
endif (SQLITE_USE_LEGACY_STRUCT)


## Build the C++ Wrapper ##

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

## Build provided copy of SQLite3 C library ##

# TODO NOCOMMIT
#find_package(sqlite3)
#if(sqlite3_VERSION VERSION_LESS "3.19")
# set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
#endif()

option(SQLITECPP_INTERNAL_SQLITE "Add the internal SQLite3 source to the project." ON)
if (SQLITECPP_INTERNAL_SQLITE)
# build the SQLite3 C library (for ease of use/compatibility) versus Linux sqlite3-dev package
Expand Down
5 changes: 5 additions & 0 deletions include/SQLiteCpp/Database.h
Expand Up @@ -17,8 +17,13 @@
// Forward declarations to avoid inclusion of <sqlite3.h> in a header
struct sqlite3;
struct sqlite3_context;

#ifndef SQLITE_USE_LEGACY_STRUCT // Since SQLITE 3.19 (used by default since SQLiteCpp 2.1.0)
typedef struct sqlite3_value sqlite3_value;
#else // Before SQLite 3.19 (legacy struct forward declaration can be activated with CMake SQLITECPP_LEGACY_STRUCT var)
struct Mem;
typedef struct Mem sqlite3_value;
#endif


namespace SQLite
Expand Down

0 comments on commit 1a2c7cb

Please sign in to comment.