diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2018-06-30 16:00:32 +0200 |
---|---|---|
committer | Sam Thursfield <sam@afuera.me.uk> | 2018-06-30 16:02:27 +0200 |
commit | 815a73cd7d044faffa70a3ee45d02a4f16fe51d9 (patch) | |
tree | 61561e87da44343b8b9dc164a55bf0734d9c42ad /meson.build | |
parent | a72d3dbd7a169ab3127cc7ddfcbb087669213b66 (diff) | |
download | tracker-815a73cd7d044faffa70a3ee45d02a4f16fe51d9.tar.gz |
meson: Fix detection of SQLite3 FTS module
Instead of running the test, we were only compiling it and thus
discovering nothing of interest.
The error messages are now clearer too.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/meson.build b/meson.build index a6f54d9bb..38eb77643 100644 --- a/meson.build +++ b/meson.build @@ -89,12 +89,29 @@ if enable_fts } ''' - sqlite3_has_builtin_fts5 = cc.compiles(sqlite3_builtin_fts5_test, - name: 'sqlite3 has builtin FTS5 module') + result = cc.run(sqlite3_builtin_fts5_test, + name: 'sqlite3 has builtin FTS5 module', + dependencies: sqlite) - if not sqlite3_has_builtin_fts5 and sqlite.version() >= '3.20.0' - error('sqlite3 >= 3.20.0 must be compiled with --enable-fts5') + if not result.compiled() + error('Failed to compile SQLite FTS test.') endif + + if result.returncode() == 0 + message('Using sqlite3 builtin FTS module') + sqlite3_has_builtin_fts5 = true + else + message('FTS support was enabled but SQLite doesn\'t have the FTS module built in') + if sqlite.version().version_compare('>= 3.20.0') + error('sqlite3 >= 3.20.0 must be compiled with --enable-fts5 in order to get FTS support.') + else + message('sqlite3 is older than version 3.20.0, using FTS module that is bundled with Tracker') + sqlite3_has_builtin_fts5 = false + endif + endif + +else + sqlite3_has_builtin_fts5 = false endif ################################################################## |