lib: centralize xapian include, enable move semantics

Only include xapian.h in one place, so we can have consistent options.
With that in place, we can enable C++ move semantics.

We don't do anything with that yet, but we check in the meson.build file
to see if we have the required xapian version.
This commit is contained in:
Dirk-Jan C. Binnema
2024-04-30 19:29:16 +03:00
parent 32bb79b316
commit 5a48664033
12 changed files with 30 additions and 30 deletions

View File

@ -191,13 +191,16 @@ gio_unix_dep = dependency('gio-unix-2.0', version: '>= 2.60')
gmime_dep = dependency('gmime-3.0', version: '>= 3.2')
thread_dep = dependency('threads')
# we need Xapian 1.4; if we have 1.4.23, we have some newer APIs.
xapian_dep = dependency('xapian-core', version:'>= 1.4.23', required:false)
if xapian_dep.found()
# we need Xapian 1.4
xapian_dep = dependency('xapian-core', version:'>= 1.4', required:true)
xapver = xapian_dep.version()
if xapver.version_compare('>= 1.4.6')
message('xapian ' + xapver + ' supports c++ move-semantics')
config_h_data.set('HAVE_XAPIAN_MOVE_SEMANTICS', 1)
endif
if xapver.version_compare('>= 1.4.23')
message('xapian ' + xapver + ' supports ngrams')
config_h_data.set('HAVE_XAPIAN_FLAG_NGRAMS', 1)
else
xapian_dep = dependency('xapian-core', version:'>= 1.4')
message('Found xapian ' + xapian_dep.version())
endif
# optionally, use Compact Language Detector2 if we can find it.