Skip to content

Commit 164a606

Browse files
authored
Merge pull request #428 Add CMake option SQLITE_ENABLE_DBSTAT_VTAB and SQLITE_ENABLE_RTREE from SRombauts/cmake-sqlite-enable-dbstat-vtab
2 parents 23a16ed + 8a3df03 commit 164a606

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ endif ()
252252
option(SQLITECPP_INTERNAL_SQLITE "Add the internal SQLite3 source to the project." ON)
253253
if (SQLITECPP_INTERNAL_SQLITE)
254254
message(STATUS "Compile sqlite3 from source in subdirectory")
255-
option(SQLITE_ENABLE_JSON1 "Enable JSON1 extension when building internal sqlite3 library." ON)
255+
option(SQLITE_ENABLE_RTREE "Enable RTree extension when building internal sqlite3 library." OFF)
256+
option(SQLITE_ENABLE_DBSTAT_VTAB "Enable DBSTAT read-only eponymous virtual table extension when building internal sqlite3 library." OFF)
256257
# build the SQLite3 C library (for ease of use/compatibility) versus Linux sqlite3-dev package
257258
add_subdirectory(sqlite3)
258259
target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)

sqlite3/CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,20 @@ if (SQLITE_ENABLE_COLUMN_METADATA)
3030
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_COLUMN_METADATA)
3131
endif (SQLITE_ENABLE_COLUMN_METADATA)
3232

33-
if (SQLITE_ENABLE_JSON1)
34-
# Enable JSON1 extension when building sqlite3
35-
# See more here: https://www.sqlite.org/json1.html
36-
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_JSON1)
37-
endif (SQLITE_ENABLE_JSON1)
38-
39-
if(SQLITE_ENABLE_RTREE)
33+
if (SQLITE_ENABLE_RTREE)
4034
# Enable RTree extension when building sqlite3
4135
# See more here: https://sqlite.org/rtree.html
4236
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_RTREE)
37+
message(STATUS "Compile sqlite3 with SQLITE_ENABLE_RTREE")
4338
endif (SQLITE_ENABLE_RTREE)
4439

40+
if (SQLITE_ENABLE_DBSTAT_VTAB)
41+
# Enable DBSTAT extension when building sqlite3
42+
# See more here: https://www.sqlite.org/dbstat.html
43+
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_DBSTAT_VTAB)
44+
message(STATUS "Compile sqlite3 with SQLITE_ENABLE_DBSTAT_VTAB")
45+
endif (SQLITE_ENABLE_DBSTAT_VTAB)
46+
4547
if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
4648
set_target_properties(sqlite3 PROPERTIES COMPILE_FLAGS "-fPIC")
4749

0 commit comments

Comments
 (0)