From 1f9740138dfd85dc03e2595c3b16de999a4674cd Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 25 Aug 2017 18:23:39 +0200 Subject: meson: Fix SQLite FTS5 check Can't compile without main() --- meson.build | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 7fdd5b3ad..4945c9a99 100644 --- a/meson.build +++ b/meson.build @@ -103,14 +103,17 @@ endif if enable_fts sqlite3_builtin_fts5_test = ''' #include - sqlite3 *db; - int rc; - rc = sqlite3_open(":memory:", &db); - if (rc!=SQLITE_OK) return -1; - rc = sqlite3_exec(db, "create table a(text)", 0, 0, 0); - if (rc!=SQLITE_OK) return -1; - rc = sqlite3_exec(db, "create virtual table t using fts5(content='a',text)", 0, 0, 0); - if (rc!=SQLITE_OK) return -1; + + int main (int argc, char *argv[]) { + sqlite3 *db; + int rc; + rc = sqlite3_open(":memory:", &db); + if (rc!=SQLITE_OK) return -1; + rc = sqlite3_exec(db, "create table a(text)", 0, 0, 0); + if (rc!=SQLITE_OK) return -1; + rc = sqlite3_exec(db, "create virtual table t using fts5(content='a',text)", 0, 0, 0); + if (rc!=SQLITE_OK) return -1; + } ''' sqlite3_has_builtin_fts5 = cc.compiles(sqlite3_builtin_fts5_test, -- cgit v1.2.1