add rustfmt target
This commit is contained in:
14
meson.build
14
meson.build
@@ -5,9 +5,15 @@ project(
|
||||
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')
|
||||
@@ -20,6 +26,14 @@ gentoo_utils = static_library(
|
||||
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')
|
||||
|
||||
Reference in New Issue
Block a user