From: Manuel Traut Date: Sat, 16 Nov 2024 16:34:46 +0100 Subject: meson: Don't relay on Cargo.lock, fix install path --- meson.build | 1 - meson_options.txt | 4 ++++ podcasts-gtk/src/meson.build | 8 ++------ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 5193d82..3becb46 100644 --- a/meson.build +++ b/meson.build @@ -42,7 +42,6 @@ endif podcast_toml = files( 'Cargo.toml', - 'Cargo.lock', 'podcasts-data/Cargo.toml', 'podcasts-gtk/Cargo.toml', ) diff --git a/meson_options.txt b/meson_options.txt index 4c5cc39..8dda4f6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,3 +7,7 @@ option ( ], value: 'default' ) +option ( + 'host_arch', + type: 'string', +) diff --git a/podcasts-gtk/src/meson.build b/podcasts-gtk/src/meson.build index 8bf8a00..1a3bcd2 100644 --- a/podcasts-gtk/src/meson.build +++ b/podcasts-gtk/src/meson.build @@ -29,8 +29,6 @@ else message('Building in debug mode') endif -cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ] - cargo_release = custom_target('cargo-build', build_by_default: true, build_always_stale: true, @@ -39,10 +37,8 @@ cargo_release = custom_target('cargo-build', install_dir: podcasts_bindir, console: true, depends: podcasts_resources, - command: ['env', - cargo_env, - cargo, 'build', + command: [cargo, 'build', cargo_options, '&&', - 'cp', 'podcasts-gtk' / 'src' / rust_target / 'podcasts-gtk', '@OUTPUT@', + 'cp', 'podcasts-gtk' / 'src' / get_option('host_arch') / rust_target / 'podcasts-gtk', '@OUTPUT@', ])