summaryrefslogtreecommitdiff
path: root/meson.build
blob: 8e712dd41fad89e9a6f3be5b3f60a3abf45be4a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
project(
    'gentoo-utils',
    ['rust', 'cpp'],
    meson_version: '>=1.9.1',
    default_options: {'rust_std': '2024', 'rust_nightly': 'enabled'},
)

rust = import('rust')
fs = import('fs')

mon = dependency('mon-0.1-rs')
get = dependency('get-0.1-rs')
itertools = dependency('itertools-0.14-rs')
thiserror = subproject('thiserror').get_variable('thiserror')

gentoo_utils = static_library(
    'gentoo_utils',
    'src/lib.rs',
    dependencies: [mon, get, itertools],
    link_with: [thiserror],
)

if get_option('tests').enabled()
    rust.test('unittests', gentoo_utils)
    subdir('tests')
endif

if get_option('fuzz').enabled()
    subdir('fuzz')
endif

if get_option('docs').enabled()
    rust.doctest(
        'doctests',
        gentoo_utils,
        dependencies: [mon, get, itertools],
        link_with: [thiserror],
        args: ['--nocapture'],
    )
endif