From 0c7bbcecf625c7222128089b1a5b815103eb17ec Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 21 Apr 2026 05:22:51 +0300 Subject: [PATCH] db.sqlite: fix no such file or directory error (fixes #26887) --- vlib/db/sqlite/README.md | 4 ++++ vlib/db/sqlite/sqlite.c.v | 3 +++ 2 files changed, 7 insertions(+) diff --git a/vlib/db/sqlite/README.md b/vlib/db/sqlite/README.md index c6699eb5c..7f2720eab 100644 --- a/vlib/db/sqlite/README.md +++ b/vlib/db/sqlite/README.md @@ -21,6 +21,10 @@ If you need to install SQLite manually, use the SQLite Do not use the autoconf/source package here, and do not rename `sqlite3.c` to `sqlite3.cpp`. +On **macOS**, V can also fall back to the system `libsqlite3` +when `pkg-config` is not available, so an extra install is often +not needed. + On **Linux**, you can also install the system development package instead: diff --git a/vlib/db/sqlite/sqlite.c.v b/vlib/db/sqlite/sqlite.c.v index eb581ddbe..e6ba77f57 100644 --- a/vlib/db/sqlite/sqlite.c.v +++ b/vlib/db/sqlite/sqlite.c.v @@ -14,6 +14,9 @@ $if $pkgconfig('sqlite3') { #flag -I@VEXEROOT/thirdparty/sqlite #include "sqlite3.h" # The SQLite header file is missing. Please run vlib/db/sqlite/install_thirdparty_sqlite.vsh to download an SQLite amalgamation. #include "sqlite3.c" # The SQLite amalgamation source file is missing. Please run vlib/db/sqlite/install_thirdparty_sqlite.vsh to download an SQLite amalgamation. +} $else $if darwin { + // macOS ships libsqlite3, so do not require a separately downloaded amalgamation. + #flag darwin -lsqlite3 } $else { #flag -I@VEXEROOT/thirdparty/sqlite #include "sqlite3.h" # The SQLite header file is missing. Please run vlib/db/sqlite/install_thirdparty_sqlite.vsh to download an SQLite amalgamation. -- 2.39.5