Skip to content

Commit 953ace5

Browse files
committed
Build SQLite3
- [x] Linux/macOS - [x] Windows
1 parent 3289c1f commit 953ace5

2 files changed

Lines changed: 76 additions & 1 deletion

File tree

library_builders.bat

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ exit /b 0
4242
-DADIOS2_USE_Python=OFF ^
4343
-DADIOS2_USE_ZeroMQ=OFF ^
4444
-DADIOS2_USE_ZFP=ON ^
45-
-DADIOS2_RUN_INSTALL_TEST=OFF
45+
-DADIOS2_RUN_INSTALL_TEST=OFF ^
46+
-DSQLite3_ROOT=%BUILD_PREFIX%/SQLite3
4647
if errorlevel 1 exit 1
4748
:: TODO: Could NOT find HDF5 (missing: HDF5_LIBRARIES C)
4849
:: -DADIOS2_USE_HDF5=ON
@@ -144,6 +145,52 @@ exit /b 0
144145
if errorlevel 1 exit 1
145146
exit /b 0
146147

148+
:build_sqlite
149+
if exist sqlite-stamp exit /b 0
150+
151+
set SQLITE_VERSION="3510200"
152+
153+
curl -sLo sqlite-amalgamation-%SQLITE_VERSION%.zip ^
154+
https://www.sqlite.org/2026/sqlite-amalgamation-%SQLITE_VERSION%.zip
155+
if errorlevel 1 exit 1
156+
157+
powershell Expand-Archive sqlite-amalgamation-%SQLITE_VERSION%.zip -DestinationPath '.'
158+
if errorlevel 1 exit 1
159+
160+
cd sqlite-amalgamation-%SQLITE_VERSION%
161+
if errorlevel 1 exit 1
162+
163+
REM Create a minimal CMakeLists.txt
164+
(
165+
echo cmake_minimum_required(VERSION 3.10^)
166+
echo project(sqlite3 C^)
167+
echo add_library(sqlite3 STATIC sqlite3.c^)
168+
echo target_compile_definitions(sqlite3 PRIVATE SQLITE_ENABLE_FTS3 SQLITE_ENABLE_FTS5 SQLITE_ENABLE_RTREE SQLITE_ENABLE_DBSTAT_VTAB SQLITE_ENABLE_RBU SQLITE_ENABLE_SESSION^)
169+
echo set_property(TARGET sqlite3 PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"^)
170+
echo install(TARGETS sqlite3 ARCHIVE DESTINATION lib^)
171+
echo install(FILES sqlite3.h DESTINATION include^)
172+
) > CMakeLists.txt
173+
174+
:: build and install
175+
cmake -S . -B build ^
176+
-DCMAKE_INSTALL_PREFIX=%BUILD_PREFIX%/SQLite3
177+
if errorlevel 1 exit 1
178+
179+
cmake --build build --config Release
180+
if errorlevel 1 exit 1
181+
182+
cmake --install build --config Release
183+
if errorlevel 1 exit 1
184+
185+
:: cleanup
186+
cd ..
187+
rmdir /s /q sqlite-amalgamation-%SQLITE_VERSION%
188+
if errorlevel 1 exit 1
189+
190+
break > sqlite-stamp
191+
if errorlevel 1 exit 1
192+
exit /b 0
193+
147194
:build_zfp
148195
if exist zfp-stamp exit /b 0
149196

@@ -209,6 +256,7 @@ exit /b 0
209256
:main
210257
call :install_buildessentials
211258
call :build_zlib
259+
call :build_sqlite
212260
:: build_bzip2
213261
:: build_szip
214262
call :build_zfp

library_builders.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,32 @@ function build_blosc2 {
173173
touch blosc-stamp2
174174
}
175175

176+
function build_sqlite {
177+
if [ -e sqlite-stamp ]; then return; fi
178+
179+
SQLITE_VERSION="3510200" # "3.51.2"
180+
181+
curl -sLO https://www.sqlite.org/2026/sqlite-autoconf-${SQLITE_VERSION}.tar.gz
182+
file sqlite-autoconf*.tar.gz
183+
tar xzf sqlite-autoconf-${SQLITE_VERSION}.tar.gz
184+
rm sqlite-autoconf*.tar.gz
185+
186+
cd sqlite-autoconf-${SQLITE_VERSION}
187+
188+
./configure \
189+
--disable-shared \
190+
--prefix=${BUILD_PREFIX} \
191+
--all \
192+
--disable-readline
193+
make
194+
${SUDO} make install
195+
196+
cd -
197+
rm -rf sqlite-autoconf*
198+
199+
touch sqlite-stamp
200+
}
201+
176202
function build_zfp {
177203
if [ -e zfp-stamp ]; then return; fi
178204

@@ -316,6 +342,7 @@ fi
316342

317343
install_buildessentials
318344
build_zlib
345+
build_sqlite
319346
build_zfp
320347
build_blosc2
321348
build_hdf5

0 commit comments

Comments
 (0)