From: David Bremner <david@tethera.net>
To: Michael J Gruber <michaeljgruber+grubix+git@gmail.com>,
David Bremner <david@tethera.net>
Cc: notmuch@notmuchmail.org
Subject: [PATCH] lib: don't compile sexp: prefix if no sfsexp library
Date: Fri, 15 Apr 2022 14:03:18 -0300 [thread overview]
Message-ID: <20220415170318.931068-1-david@tethera.net> (raw)
In-Reply-To: <CAA19uiRpGpTTPsoMRJtaUO8077gh6MyGYgSagRH-h4ewQBa9Gg@mail.gmail.com>
As Michael Gruber pointed out, the build is otherwise broken on
systems without libsfsexp.
---
lib/prefix.cc | 4 ++++
lib/sexp-fp.cc | 3 +++
lib/sexp-fp.h | 2 ++
3 files changed, 9 insertions(+)
diff --git a/lib/prefix.cc b/lib/prefix.cc
index 06e2333a..538a2dd1 100644
--- a/lib/prefix.cc
+++ b/lib/prefix.cc
@@ -61,8 +61,10 @@ prefix_t prefix_table[] = {
NOTMUCH_FIELD_PROCESSOR },
{ "query", NULL, NOTMUCH_FIELD_EXTERNAL |
NOTMUCH_FIELD_PROCESSOR },
+#if HAVE_SFSEXP
{ "sexp", NULL, NOTMUCH_FIELD_EXTERNAL |
NOTMUCH_FIELD_PROCESSOR },
+#endif
{ "from", "XFROM", NOTMUCH_FIELD_EXTERNAL |
NOTMUCH_FIELD_PROBABILISTIC |
NOTMUCH_FIELD_PROCESSOR },
@@ -141,8 +143,10 @@ _setup_query_field (const prefix_t *prefix, notmuch_database_t *notmuch)
fp = (new QueryFieldProcessor (*notmuch->query_parser, notmuch))->release ();
else if (STRNCMP_LITERAL (prefix->name, "thread") == 0)
fp = (new ThreadFieldProcessor (*notmuch->query_parser, notmuch))->release ();
+#if HAVE_SFSEXP
else if (STRNCMP_LITERAL (prefix->name, "sexp") == 0)
fp = (new SexpFieldProcessor (notmuch))->release ();
+#endif
else
fp = (new RegexpFieldProcessor (prefix->name, prefix->flags,
*notmuch->query_parser, notmuch))->release ();
diff --git a/lib/sexp-fp.cc b/lib/sexp-fp.cc
index ed26f6ec..eeb8be98 100644
--- a/lib/sexp-fp.cc
+++ b/lib/sexp-fp.cc
@@ -21,6 +21,8 @@
*/
#include "database-private.h"
+
+#if HAVE_SFSEXP
#include "sexp-fp.h"
#include <iostream>
@@ -38,3 +40,4 @@ SexpFieldProcessor::operator() (const std::string & query_string)
return output;
}
+#endif /* HAVE_SFSEXP */
diff --git a/lib/sexp-fp.h b/lib/sexp-fp.h
index 341dfa7e..0e55b961 100644
--- a/lib/sexp-fp.h
+++ b/lib/sexp-fp.h
@@ -23,6 +23,7 @@
#ifndef NOTMUCH_SEXP_FP_H
#define NOTMUCH_SEXP_FP_H
+#if HAVE_SFSEXP
#include <xapian.h>
#include "notmuch.h"
@@ -38,4 +39,5 @@ public:
Xapian::Query operator() (const std::string & query_string);
};
+#endif /* HAVE_SFSEXP */
#endif /* NOTMUCH_SEXP_FP_H */
--
2.35.1
prev parent reply other threads:[~2022-04-15 17:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-09 19:45 v2 allow sexp queries in infix parser David Bremner
2022-04-09 19:45 ` [PATCH v2 1/2] test/sexp: add test for and of stemmed terms David Bremner
2022-04-09 19:45 ` [PATCH v2 2/2] lib: add sexp: prefix to Xapian (infix) query parser David Bremner
2022-04-15 11:32 ` David Bremner
2022-04-15 16:03 ` Michael J Gruber
2022-04-15 16:23 ` [PATCH] fix build without sfsexp michaeljgruber+grubix+git
2022-04-15 17:31 ` David Bremner
2022-04-15 17:03 ` David Bremner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220415170318.931068-1-david@tethera.net \
--to=david@tethera.net \
--cc=michaeljgruber+grubix+git@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).