add meson build options to build for flathub

This commit is contained in:
2024-02-18 14:04:47 +01:00
parent 4bf08923b1
commit 282134cdf8
2 changed files with 11 additions and 3 deletions

View File

@@ -25,13 +25,20 @@ if get_option('profile') == 'default'
cargo_options += [ '--release' ]
rust_target = 'release'
message('Building in release mode')
else
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
endif
if get_option('profile') == 'flathub'
cargo_options += [ '--release', '--offline' ]
rust_target = 'release'
message('Building in flathub release mode')
cargo_env = [ 'CARGO_HOME=/run/build/toolbx-tuner/cargo' ]
endif
if get_option('profile') == 'development'
rust_target = 'debug'
message('Building in debug mode')
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
endif
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
cargo_build = custom_target(
'cargo-build',
build_by_default: true,