fp in env

This commit is contained in:
psykose 2024-11-25 18:08:11 +01:00
parent 5f7a00709f
commit 16eb77c20a
Signed by: psykose
SSH key fingerprint: SHA256:pRMVjV3kRB6zl+wNx+sV8KoMnPqQAW6v8dNCxsCGZv8

View file

@ -38,16 +38,17 @@ subdir('po')
subdir('resources') subdir('resources')
subdir('src') 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 = find_program('cargo')
cargo_env = environment() 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('MESON_BUILD_ROOT', meson.project_build_root())
cargo_env.set('CARGO_MANIFEST_DIR', meson.project_source_root()) cargo_env.set('CARGO_MANIFEST_DIR', meson.project_source_root())
cargo_env.set('CARGO_TARGET_DIR', meson.project_build_root() / 'target') cargo_env.set('CARGO_TARGET_DIR', meson.project_build_root() / 'target')
@ -64,6 +65,6 @@ custom_target(
console: true, console: true,
# means nothing (always stale and uncopied), we can't cp since env: drops the /bin/sh wrapper # means nothing (always stale and uncopied), we can't cp since env: drops the /bin/sh wrapper
output: meson.project_name(), output: meson.project_name(),
command: [cargo, 'build', rust_args], command: [cargo, 'build', cargo_args],
env: cargo_env, env: cargo_env,
) )