diff --git a/lib/message/mu-document.hh b/lib/message/mu-document.hh index ef045772..5119044c 100644 --- a/lib/message/mu-document.hh +++ b/lib/message/mu-document.hh @@ -19,7 +19,6 @@ #ifndef MU_DOCUMENT_HH__ #define MU_DOCUMENT_HH__ -#include #include #include #include diff --git a/lib/message/mu-fields.hh b/lib/message/mu-fields.hh index aa1ae0fb..19a222b9 100644 --- a/lib/message/mu-fields.hh +++ b/lib/message/mu-fields.hh @@ -1,5 +1,5 @@ /* -** Copyright (C) 2022-2023 Dirk-Jan C. Binnema +** Copyright (C) 2022-2024 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/lib/message/mu-message.hh b/lib/message/mu-message.hh index 8fb9f4d2..0f029f40 100644 --- a/lib/message/mu-message.hh +++ b/lib/message/mu-message.hh @@ -1,5 +1,5 @@ /* -** Copyright (C) 2022-2023 Dirk-Jan C. Binnema +** Copyright (C) 2022-2024 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -25,6 +25,8 @@ #include #include +#include "mu-xapian-db.hh" + #include "mu-contact.hh" #include "mu-priority.hh" #include "mu-flags.hh" @@ -33,8 +35,6 @@ #include "mu-message-part.hh" #include "mu-message-file.hh" -#include - #include "utils/mu-utils.hh" #include "utils/mu-option.hh" #include "utils/mu-result.hh" diff --git a/lib/mu-config.hh b/lib/mu-config.hh index afbfda85..17924c7d 100644 --- a/lib/mu-config.hh +++ b/lib/mu-config.hh @@ -29,8 +29,6 @@ #include #include -#include - #include "mu-xapian-db.hh" #include diff --git a/lib/mu-query-match-deciders.hh b/lib/mu-query-match-deciders.hh index 91488a5e..bd196059 100644 --- a/lib/mu-query-match-deciders.hh +++ b/lib/mu-query-match-deciders.hh @@ -1,5 +1,5 @@ /* -** Copyright (C) 2021 Dirk-Jan C. Binnema +** Copyright (C) 2021-2024 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -24,7 +24,7 @@ #include #include -#include +#include "mu-xapian-db.hh" #include "mu-query-results.hh" diff --git a/lib/mu-query-parser.hh b/lib/mu-query-parser.hh index f78011bf..72b23a7d 100644 --- a/lib/mu-query-parser.hh +++ b/lib/mu-query-parser.hh @@ -1,5 +1,5 @@ /* -** Copyright (C) 2023 Dirk-Jan C. Binnema +** Copyright (C) 2023-2024 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -16,11 +16,9 @@ ** Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** */ -#include #include -#include -#include +#include "mu-xapian-db.hh" #include "utils/mu-sexp.hh" #include "utils/mu-result.hh" diff --git a/lib/mu-query-results.hh b/lib/mu-query-results.hh index 479bd6c2..0123ab40 100644 --- a/lib/mu-query-results.hh +++ b/lib/mu-query-results.hh @@ -1,5 +1,5 @@ /* -** Copyright (C) 2022 Dirk-Jan C. Binnema +** Copyright (C) 2022-2024 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -33,12 +33,11 @@ #include #include -#include #include +#include #include #include -#include #include diff --git a/lib/mu-query.cc b/lib/mu-query.cc index 730a38c2..5b76005b 100644 --- a/lib/mu-query.cc +++ b/lib/mu-query.cc @@ -1,5 +1,5 @@ /* -** Copyright (C) 2008-2023 Dirk-Jan C. Binnema +** Copyright (C) 2008-2024 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -26,13 +26,12 @@ #include #include -#include #include +#include "mu-xapian-db.hh" #include "mu-query-results.hh" #include "mu-query-match-deciders.hh" #include "mu-query-threads.hh" -#include "mu-xapian-db.hh" #include "mu-query-parser.hh" diff --git a/lib/mu-store.hh b/lib/mu-store.hh index b6a09236..dd490451 100644 --- a/lib/mu-store.hh +++ b/lib/mu-store.hh @@ -26,8 +26,6 @@ #include #include -#include - #include "mu-contacts-cache.hh" #include "mu-xapian-db.hh" #include "mu-config.hh" diff --git a/lib/mu-xapian-db.hh b/lib/mu-xapian-db.hh index d4fca66d..f9753c60 100644 --- a/lib/mu-xapian-db.hh +++ b/lib/mu-xapian-db.hh @@ -29,10 +29,17 @@ #include -#include #include #include +/* starting with 1.4.6, Xapian supports C++ move semantics, + * but only with XAPIAN_MOVE_SEMANTICS defined + */ +#ifndef XAPIAN_MOVE_SEMANTICS +#define XAPIAN_MOVE_SEMANTICS +#endif /*XAPIAN_MOVE_SEMANTICS*/ +#include + namespace Mu { // LCOV_EXCL_START diff --git a/meson.build b/meson.build index 84ea0735..5d91a8b6 100644 --- a/meson.build +++ b/meson.build @@ -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. diff --git a/mu/mu-cmd-info.cc b/mu/mu-cmd-info.cc index fcc96706..2e155fc7 100644 --- a/mu/mu-cmd-info.cc +++ b/mu/mu-cmd-info.cc @@ -21,7 +21,6 @@ #include "mu-cmd.hh" #include -#include #include "utils/mu-utils.hh" #include