lib: move index/ into main lib/

simplify things a bit
This commit is contained in:
Dirk-Jan C. Binnema 2023-09-10 08:45:24 +03:00
parent d528b4b818
commit 53c7381929
11 changed files with 45 additions and 93 deletions

View File

@ -1,60 +0,0 @@
## Copyright (C) 2021-2023 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
##
## 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 Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
index_srcs=[
'mu-indexer.hh',
'mu-indexer.cc',
'mu-scanner.hh',
'mu-scanner.cc'
]
xapian_incs = xapian_dep.get_variable(pkgconfig: 'includedir')
lib_mu_index_inc_dep = declare_dependency(
include_directories: include_directories(['.', '..', xapian_incs]))
lib_mu_index=static_library('mu-index', [index_srcs],
dependencies: [
config_h_dep,
glib_dep,
lib_mu_utils_dep,
lib_mu_index_inc_dep
],
install: false)
lib_mu_index_dep = declare_dependency(
link_with: lib_mu_index
)
#
# test tool
#
executable('list-maildirs', 'mu-scanner.cc',
install: false,
cpp_args: ['-DBUILD_LIST_MAILDIRS'],
dependencies: [glib_dep, config_h_dep,
lib_mu_utils_dep])
#
# unit tests
#
test('test-scanner',
executable('test-scanner', 'mu-scanner.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, config_h_dep,
lib_mu_utils_dep]))

View File

@ -17,26 +17,31 @@
subdir('utils')
subdir('message')
subdir('index')
lib_mu=static_library(
'mu',
[
'mu-bookmarks.cc',
# db
'mu-config.cc',
'mu-contacts-cache.cc',
'mu-maildir.cc',
'mu-query-match-deciders.cc',
'mu-query-threads.cc',
'mu-query.cc',
'mu-script.cc',
'mu-server.cc',
'mu-store.cc',
'mu-xapian-db.cc',
# query-parser
'mu-query-processor.cc',
# querying
'mu-bookmarks.cc',
'mu-query-match-deciders.cc',
'mu-query-parser.cc',
'mu-query-xapianizer.cc'
'mu-query-processor.cc',
'mu-query-threads.cc',
'mu-query-xapianizer.cc',
'mu-query.cc',
# indexing
'mu-indexer.cc',
'mu-scanner.cc',
# mu4e
'mu-server.cc',
# misc
'mu-maildir.cc',
'mu-script.cc',
],
dependencies: [
glib_dep,
@ -46,11 +51,9 @@ lib_mu=static_library(
guile_dep,
config_h_dep,
lib_mu_utils_dep,
lib_mu_message_dep,
lib_mu_index_dep],
lib_mu_message_dep],
install: false)
lib_mu_dep = declare_dependency(
link_with: lib_mu,
dependencies: [ lib_mu_message_dep, thread_dep ],
@ -58,8 +61,9 @@ lib_mu_dep = declare_dependency(
include_directories(['.', '..']))
#
# query parser dev helpers
# dev helpers
#
process_query = executable('process-query', [ 'mu-query-processor.cc'],
install: false,
cpp_args: ['-DBUILD_PROCESS_QUERY'],
@ -80,6 +84,12 @@ xapian_query = executable('xapianize-query', [ 'mu-query-xapianizer.cc' ],
cpp_args: ['-DBUILD_XAPIANIZE_QUERY'],
dependencies: [glib_dep, lib_mu_dep])
list_maildirs = executable('list-maildirs', 'mu-scanner.cc',
install: false,
cpp_args: ['-DBUILD_LIST_MAILDIRS'],
dependencies: [glib_dep, config_h_dep,
lib_mu_utils_dep])
#
# unit tests
#
@ -125,4 +135,12 @@ test('test-query-xapianizer',
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep]))
test('test-scanner',
executable('test-scanner', 'mu-scanner.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, config_h_dep,
lib_mu_utils_dep]))
subdir('tests')

View File

@ -18,9 +18,9 @@
*/
#include "config.h"
#include "mu-server.hh"
#include "message/mu-message.hh"
#include "mu-server.hh"
#include <fstream>
#include <sstream>
@ -39,7 +39,6 @@
#include "mu-maildir.hh"
#include "mu-query.hh"
#include "index/mu-indexer.hh"
#include "mu-store.hh"
#include "utils/mu-utils.hh"

View File

@ -18,28 +18,23 @@
*/
#include "config.h"
#include "mu-store.hh"
#include <chrono>
#include <memory>
#include <mutex>
#include <array>
#include <cstdlib>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <atomic>
#include <type_traits>
#include <iostream>
#include <cstring>
#include <vector>
#include <xapian.h>
#include "mu-maildir.hh"
#include "mu-store.hh"
#include "mu-query.hh"
#include "mu-xapian-db.hh"
#include "index/mu-scanner.hh"
#include "mu-scanner.hh"
#include "utils/mu-error.hh"

View File

@ -17,22 +17,24 @@
**
*/
#ifndef __MU_STORE_HH__
#define __MU_STORE_HH__
#ifndef MU_STORE_HH__
#define MU_STORE_HH__
#include <string>
#include <vector>
#include <mutex>
#include <ctime>
#include <memory>
#include <xapian.h>
#include "mu-contacts-cache.hh"
#include "mu-xapian-db.hh"
#include "mu-config.hh"
#include <xapian.h>
#include "mu-indexer.hh"
#include "mu-query-results.hh"
#include <utils/mu-utils.hh>
#include <index/mu-indexer.hh>
#include <mu-query-results.hh>
#include <utils/mu-utils.hh>
#include <utils/mu-option.hh>
@ -476,4 +478,4 @@ format_as(const Store& store)
} // namespace Mu
#endif /* __MU_STORE_HH__ */
#endif /* MU_STORE_HH__ */

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2022 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2022-2023 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** 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
@ -27,7 +27,6 @@
#include "mu-store.hh"
#include "mu-query.hh"
#include "index/mu-indexer.hh"
#include "utils/mu-result.hh"
#include "utils/mu-utils.hh"
#include "utils/mu-test-utils.hh"

View File

@ -30,7 +30,6 @@
#include <signal.h>
#include <unistd.h>
#include "index/mu-indexer.hh"
#include "mu-store.hh"
using namespace Mu;