diff --git a/meson.build b/meson.build index 5a8df45..0c8e3e2 100644 --- a/meson.build +++ b/meson.build @@ -38,16 +38,17 @@ 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') cargo_env = environment() + +if get_option('buildtype') == 'debug' + cargo_args = [] + cargo_env.append('RUSTFLAGS', '-Cforce-frame-pointers=true', separator: ' ') +else + cargo_args = ['--release'] + extra_rustflags = [] +endif + cargo_env.set('MESON_BUILD_ROOT', meson.project_build_root()) cargo_env.set('CARGO_MANIFEST_DIR', meson.project_source_root()) cargo_env.set('CARGO_TARGET_DIR', meson.project_build_root() / 'target') @@ -64,6 +65,6 @@ custom_target( console: true, # means nothing (always stale and uncopied), we can't cp since env: drops the /bin/sh wrapper output: meson.project_name(), - command: [cargo, 'build', rust_args], + command: [cargo, 'build', cargo_args], env: cargo_env, )