From 2bba51b97b230f480f6181f33ba4ea315539185d Mon Sep 17 00:00:00 2001 From: psykose Date: Tue, 29 Oct 2024 19:13:49 +0100 Subject: [PATCH] meson stuff --- .gitignore | 1 + meson.build | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f7896d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target/ diff --git a/meson.build b/meson.build index 5c61ac8..4d8748d 100644 --- a/meson.build +++ b/meson.build @@ -43,8 +43,15 @@ subdir('po') subdir('resources') subdir('src') +if get_option('buildtype') == 'debug' + rust_args = [] + rust_target = 'debug' +else + rust_args = ['--release'] + rust_target = 'release' +endif + cargo = find_program('cargo') -# TODO: cargo release build custom_target( 'cargo-build', build_by_default: true, @@ -53,19 +60,20 @@ custom_target( audrey_c, blueprints, ], + console: true, output: meson.project_name(), command: [ 'env', - 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home', 'RUSTFLAGS=-L ' + fs.parent(audrey_c.full_path()), 'MESON_BUILD_ROOT=' + meson.project_build_root(), cargo, 'build', + rust_args, '--manifest-path', meson.project_source_root() / 'Cargo.toml', '--target-dir', meson.project_build_root() / 'cargo-target', '&&', 'cp', - 'cargo-target' / 'debug' / meson.project_name(), + 'cargo-target' / rust_target / meson.project_name(), '@OUTPUT@', ], )