Files
gentoo-utils-gitea/meson.build
John Turner 53f2798549
Some checks failed
Gentoo Utils / build-oci-image (push) Successful in 9s
Gentoo Utils / build (push) Failing after 27s
add rustfmt target
2025-12-08 21:23:38 +00:00

55 lines
1.1 KiB
Meson

project(
'gentoo-utils',
['rust', 'cpp'],
meson_version: '>=1.9.1',
default_options: {'rust_std': '2024', 'rust_nightly': 'enabled'},
)
rustfmt = find_program('rustfmt')
rust = import('rust')
fs = import('fs')
sources = []
subdir('src')
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],
)
custom_target(
'rustfmt',
input: sources,
output: 'rustfmt',
command: [rustfmt, '--edition=2024', '--check', '@INPUT@'],
build_always_stale: true,
)
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