From d8e8541059508ce2072636e118ae435fa6653a43 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 5 Aug 2022 00:30:15 -0400 Subject: [PATCH] build: Replace deprecated build_root() and source_root() calls Also use variables since we call these functions multiple times - might as well cache them since they stay the same the whole time. --- src/meson.build | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/meson.build b/src/meson.build index ca687e8..58a9b65 100644 --- a/src/meson.build +++ b/src/meson.build @@ -4,16 +4,19 @@ configure_file( configuration: conf ) +build_root = meson.project_build_root() +source_root = meson.project_source_root() + # Copy the config.rs output to the source directory. run_command( 'cp', - meson.build_root() / 'src' / 'config.rs', - meson.source_root() / 'src' / 'config.rs', + build_root / 'src' / 'config.rs', + source_root / 'src' / 'config.rs', check: true ) -cargo_options = [ '--manifest-path', meson.source_root() / 'Cargo.toml' ] -cargo_options += [ '--target-dir', meson.build_root() / 'src' ] +cargo_options = [ '--manifest-path', source_root / 'Cargo.toml' ] +cargo_options += [ '--target-dir', build_root / 'src' ] if get_option('profile') == 'default' cargo_options += [ '--release' ] @@ -24,7 +27,7 @@ else message('Building in debug mode') endif -cargo_env = [ 'CARGO_HOME=' + meson.build_root() / 'cargo-home' ] +cargo_env = [ 'CARGO_HOME=' + build_root / 'cargo-home' ] cargo_release = custom_target( 'cargo-build',