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