[fontations] Add fmt-check target

This commit is contained in:
Behdad Esfahbod 2025-03-07 21:09:17 -07:00
parent a68f458612
commit 8fd718c9eb
2 changed files with 15 additions and 0 deletions

View file

@ -465,6 +465,7 @@ alias_target('libs', libharfbuzz, libharfbuzz_subset)
if get_option('fontations').enabled()
alias_target('clippy', clippy)
alias_target('fmt', fmt)
alias_target('fmt-check', fmt_check)
endif
if meson.version().version_compare('>=0.57.0')

View file

@ -83,3 +83,17 @@ fmt = custom_target(
meson.current_source_dir() / 'lib.rs',
],
)
fmt_check = custom_target(
'fmt-check',
input: 'lib.rs',
output: 'fmt-check',
depends: [hb_rs],
env: ['OUT_DIR=' + meson.current_build_dir()],
command: [
rustfmt,
'--check',
'--edition', '2021',
'--',
meson.current_source_dir() / 'lib.rs',
],
)