Skip to content

Commit 03367dc

Browse files
committed
build: update cmake build system
1. Add a configuration option for macro SQLITE_ENABLE_CARRAY. This option enables the carray() extension. 2. Add a configuration option for macro SQLITE_ENABLE_PERCENTILE. This option enables the percentile extension.
1 parent bd2be12 commit 03367dc

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ set(SQLITE_MAX_ALLOCATION_SIZE -1 CACHE STRING "Set an upper bound on the size o
6969
set(SQLITE_MAX_EXPR_DEPTH -1 CACHE STRING "Set the maximum expression tree depth.")
7070

7171
option(SQLITE_ENABLE_API_ARMOR "This option activates extra code that attempts to detect misuse of the SQLite API." OFF)
72+
option(SQLITE_ENABLE_CARRAY "Enable the carray() extension." OFF)
7273
option(SQLITE_ENABLE_COLUMN_METADATA "Enable some extra APIs that are required by some common systems, including Ruby-on-Rails." OFF)
7374
option(SQLITE_ENABLE_DBSTAT_VTAB "This option enables the dbstat virtual table." OFF)
7475
option(SQLITE_ENABLE_EXPLAIN_COMMENTS "This option adds extra logic to SQLite that inserts comment text into the output of EXPLAIN." OFF)
@@ -80,6 +81,7 @@ option(SQLITE_ENABLE_GEOPOLY "Enable the Geopoly extension." OFF)
8081
option(SQLITE_ENABLE_ICU "Enable the ICU (International Components for Unicode) extension" OFF)
8182
option(SQLITE_ENABLE_MATH_FUNCTIONS "Enable the built-in SQL math functions." ON)
8283
option(SQLITE_ENABLE_NORMALIZE "Enable the sqlite3_normalized_sql() API." OFF)
84+
option(SQLITE_ENABLE_PERCENTILE "Enable the percentile extension." OFF)
8385
option(SQLITE_ENABLE_PREUPDATE_HOOK "Enable the pre-update hook feature." OFF)
8486
option(SQLITE_ENABLE_RBU "Enable the code that implements the RBU extension." OFF)
8587
option(SQLITE_ENABLE_RTREE "This option causes SQLite to include support for the R*Tree index extension." OFF)
@@ -224,6 +226,10 @@ if(WIN32 AND BUILD_SHARED_LIBS)
224226
INTERFACE "SQLITE_API=__declspec(dllimport)")
225227
endif()
226228

229+
if(SQLITE_ENABLE_CARRAY)
230+
target_compile_definitions(SQLite3 PUBLIC SQLITE_ENABLE_CARRAY)
231+
endif()
232+
227233
if(SQLITE_ENABLE_NORMALIZE)
228234
target_compile_definitions(SQLite3 PUBLIC SQLITE_ENABLE_NORMALIZE)
229235
endif()
@@ -272,6 +278,7 @@ target_compile_definitions(SQLite3
272278
$<$<BOOL:${SQLITE_ENABLE_GEOPOLY}>:SQLITE_ENABLE_GEOPOLY>
273279
$<$<BOOL:${SQLITE_ENABLE_ICU}>:SQLITE_ENABLE_ICU>
274280
$<$<BOOL:${SQLITE_ENABLE_MATH_FUNCTIONS}>:SQLITE_ENABLE_MATH_FUNCTIONS>
281+
$<$<BOOL:${SQLITE_ENABLE_PERCENTILE}>:SQLITE_ENABLE_PERCENTILE>
275282
$<$<BOOL:${SQLITE_ENABLE_RBU}>:SQLITE_ENABLE_RBU>
276283
$<$<BOOL:${SQLITE_ENABLE_RTREE}>:SQLITE_ENABLE_RTREE>
277284
$<$<BOOL:${SQLITE_ENABLE_STMTVTAB}>:SQLITE_ENABLE_STMTVTAB>

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ system if you need them.
161161
value is a **boolean**.
162162
This option activates extra code that attempts to detect misuse of the SQLite API.
163163

164+
- `SQLITE_ENABLE_CARRAY:BOOL`=**OFF**:
165+
value is a **boolean**.
166+
This option enables the carray() extension.
167+
164168
- `SQLITE_ENABLE_DBSTAT_VTAB:BOOL`=**OFF**:
165169
value is a **boolean**.
166170
This option enables the dbstat virtual table.
@@ -207,6 +211,10 @@ system if you need them.
207211
When this option is defined the sqlite3_normalized_sql() API is included in
208212
the build.
209213

214+
- `SQLITE_ENABLE_PERCENTILE:BOOL`=**OFF**:
215+
value is a **boolean**.
216+
This option enables the percentile extension.
217+
210218
- `SQLITE_ENABLE_PREUPDATE_HOOK:BOOL`=**OFF**:
211219
value is a **boolean**.
212220
When this option is defined the pre-update hook APIs are included in the build.

0 commit comments

Comments
 (0)