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.
This commit is contained in:
parent
7b68bd78a0
commit
d8e8541059
1 changed files with 8 additions and 5 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue