From fe77c4dbf6d7e3abe145a979f697b227a83cdb6e Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Sat, 16 Dec 2017 15:02:10 +0000 Subject: meson: Fix build with libstemmer Based on a patch by Jeremy Bicha . https://bugzilla.gnome.org/show_bug.cgi?id=790373 --- meson.build | 4 ++-- meson_options.txt | 2 +- src/libtracker-common/meson.build | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 36e008447..8a159af50 100644 --- a/meson.build +++ b/meson.build @@ -54,8 +54,8 @@ enable_fts = get_option('fts') have_libstemmer = false if get_option('stemmer') != 'no' - stemmer = cc.find_library('stemmer') - if stemmer.found() + libstemmer = cc.find_library('stemmer', required: false) + if libstemmer.found() have_libstemmer = true elif get_option('stemmer') == 'yes' error('stemmer support explicitly requested, but stemmer library couldn\'t be found') diff --git a/meson_options.txt b/meson_options.txt index 496d35613..05c65c948 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,7 +7,7 @@ option('functional_tests', type: 'boolean', value: true, option('journal', type: 'boolean', value: true, description: 'Enable database journal backup mechanism') -option('stemmer', type: 'combo', choices: ['auto', 'no', 'yes'], value: 'no', +option('stemmer', type: 'combo', choices: ['auto', 'no', 'yes'], value: 'auto', description: 'Enable stemming words while indexing') option('unicode_support', type: 'combo', choices: ['icu', 'unistring', 'auto'], value: 'auto', description: 'Unicode support library to use') diff --git a/src/libtracker-common/meson.build b/src/libtracker-common/meson.build index d56d909a7..4e82e6c7e 100644 --- a/src/libtracker-common/meson.build +++ b/src/libtracker-common/meson.build @@ -38,6 +38,10 @@ endif # FIXME: need to link against -lkvm on OpenBSD, see configure.ac tracker_common_dependencies = [glib, gio, gio_unix, libmath] +if have_libstemmer + tracker_common_dependencies += [libstemmer] +endif + libtracker_common = library('tracker-common', tracker_common_sources, dependencies: tracker_common_dependencies + [unicode_library], -- cgit v1.2.1