[fontations] Consolidate args a bit

This commit is contained in:
Behdad Esfahbod 2025-03-08 12:13:31 -07:00
parent c3eac5c0f3
commit e8ddb4325b

View file

@ -14,7 +14,14 @@ cargo = find_program('cargo')
rustfmt = find_program('rustfmt')
rust_flags = ''
cargo_args = []
cargo_args = [
'--package', 'harfbuzz_fontations',
'--lib',
'--target-dir', meson.current_build_dir(),
'--manifest-path', meson.current_source_dir() / 'Cargo.toml',
'-Z', 'build-std=std,panic_abort',
'-Z', 'build-std-features=panic_immediate_abort',
]
buildtype = get_option('buildtype')
if buildtype == 'release' or buildtype == 'debugoptimized'
@ -24,9 +31,6 @@ endif
opt_level = get_option('optimization')
rust_flags += ' -C opt-level=' + opt_level
cargo_args += ['-Z', 'build-std=std,panic_abort',
'-Z', 'build-std-features=panic_immediate_abort']
harfbuzz_fontations = custom_target(
'harfbuzz_fontations',
input: ['lib.rs', 'Cargo.toml', 'Cargo.lock'],
@ -38,11 +42,8 @@ harfbuzz_fontations = custom_target(
command: [
cargo, 'build',
] + cargo_args + [
'--lib',
'--target-dir', meson.current_build_dir(),
'-Z', 'unstable-options',
'--artifact-dir', meson.current_build_dir(),
'--manifest-path', meson.current_source_dir() / 'Cargo.toml'
],
install: true,
install_dir: join_paths(get_option('prefix'), 'lib'),
@ -57,11 +58,8 @@ clippy_fix = run_target(
env: ['OUT_DIR=' + meson.current_build_dir()],
command: [
cargo, 'clippy',
'--allow-dirty', '--fix',
] + cargo_args + [
'--lib', '-p', 'harfbuzz_fontations',
'--target-dir', meson.current_build_dir(),
'--manifest-path', meson.current_source_dir() / 'Cargo.toml',
'--allow-dirty', '--fix',
],
)
if get_option('tests').enabled() and cargo.found()
@ -72,9 +70,6 @@ if get_option('tests').enabled() and cargo.found()
args: [
'clippy',
] + cargo_args + [
'--lib', '-p', 'harfbuzz_fontations',
'--target-dir', meson.current_build_dir(),
'--manifest-path', meson.current_source_dir() / 'Cargo.toml',
'--', '-D', 'warnings',
],
)