1 project('plocate', 'cpp', default_options: ['buildtype=debugoptimized','cpp_std=c++17'], version: '1.0.0-pre')
3 cxx = meson.get_compiler('cpp')
4 uringdep = dependency('liburing', required: false)
5 zstddep = dependency('libzstd')
7 if not uringdep.found()
8 add_project_arguments('-DWITHOUT_URING', language: 'cpp')
11 executable('plocate', ['plocate.cpp', 'io_uring_engine.cpp', 'turbopfor.cpp'],
12 dependencies: [uringdep, zstddep],
14 install_mode: ['rwxr-sr-x', 'root', 'mlocate'])
15 executable('plocate-build', 'plocate-build.cpp',
16 dependencies: [zstddep],
18 install_dir: get_option('sbindir'))
20 install_data('update-plocate.sh',
21 install_dir: '/etc/cron.daily',
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,