]> git.sesse.net Git - plocate/blob - meson.build
Support case-insensitive searches.
[plocate] / meson.build
1 project('plocate', 'cpp', default_options: ['buildtype=debugoptimized','cpp_std=c++17'], version: '1.0.0-pre')
2
3 cxx = meson.get_compiler('cpp')
4 uringdep = dependency('liburing', required: false)
5 zstddep = dependency('libzstd')
6
7 if not uringdep.found()
8         add_project_arguments('-DWITHOUT_URING', language: 'cpp')
9 endif
10
11 executable('plocate', ['plocate.cpp', 'io_uring_engine.cpp', 'turbopfor.cpp', 'parse_trigrams.cpp'],
12         dependencies: [uringdep, zstddep],
13         install: true,
14         install_mode: ['rwxr-sr-x', 'root', 'mlocate'])
15 executable('plocate-build', 'plocate-build.cpp',
16         dependencies: [zstddep],
17         install: true,
18         install_dir: get_option('sbindir'))
19
20 install_data('update-plocate.sh',
21         install_dir: '/etc/cron.daily',
22         rename: 'plocate')
23
24 # Requires having TurboPFor checked out, so not built by default.
25 # Unless you have a recent Meson, there's no apparently good way
26 # of calling into that directory to run make, and we're not
27 # replicating their build system, so it has to be manual.
28 pfordir = meson.source_root() + '/TurboPFor-Integer-Compression'
29 if run_command('[', '-r', pfordir + '/libic.a', ']').returncode() == 0
30         turbopfordep = declare_dependency(
31                 include_directories: include_directories('TurboPFor-Integer-Compression'),
32                 dependencies: meson.get_compiler('cpp').find_library('ic', dirs: pfordir))
33         executable('bench', ['bench.cpp', 'io_uring_engine.cpp'],
34                 dependencies: [uringdep, turbopfordep],
35                 build_by_default: false,
36                 install: false)
37 endif