meson: Cleanups
This commit is contained in:
parent
895babbe82
commit
9b56f30c3b
2 changed files with 15 additions and 28 deletions
|
|
@ -1,8 +1,4 @@
|
|||
configure_file(
|
||||
input: 'config.rs.in',
|
||||
output: 'config.rs',
|
||||
configuration: conf
|
||||
)
|
||||
configure_file(input: 'config.rs.in', output: 'config.rs', configuration: conf)
|
||||
|
||||
build_root = meson.project_build_root()
|
||||
source_root = meson.project_source_root()
|
||||
|
|
@ -12,26 +8,26 @@ run_command(
|
|||
'cp',
|
||||
build_root / 'src' / 'config.rs',
|
||||
source_root / 'src' / 'config.rs',
|
||||
check: true
|
||||
check: true,
|
||||
)
|
||||
|
||||
cargo_options = [ '--manifest-path', source_root / 'Cargo.toml' ]
|
||||
cargo_options += [ '--target-dir', build_root / 'src' ]
|
||||
cargo_options = ['--manifest-path', source_root / 'Cargo.toml']
|
||||
cargo_options += ['--target-dir', build_root / 'src']
|
||||
|
||||
if get_option('profile') == 'development'
|
||||
rust_target = 'debug'
|
||||
message('Building in debug mode')
|
||||
else
|
||||
cargo_options += [ '--release' ]
|
||||
cargo_options += ['--release']
|
||||
rust_target = 'release'
|
||||
message('Building in release mode')
|
||||
endif
|
||||
|
||||
if gtk4_x11.found()
|
||||
cargo_options += [ '--features', 'x11' ]
|
||||
cargo_options += ['--features', 'x11']
|
||||
endif
|
||||
|
||||
cargo_env = { 'CARGO_HOME': build_root / 'cargo-home' }
|
||||
cargo_env = {'CARGO_HOME': build_root / 'cargo-home'}
|
||||
|
||||
cargo_build = custom_target(
|
||||
'cargo-build',
|
||||
|
|
@ -41,12 +37,13 @@ cargo_build = custom_target(
|
|||
console: true,
|
||||
env: cargo_env,
|
||||
command: [
|
||||
cargo, 'build',
|
||||
cargo,
|
||||
'build',
|
||||
cargo_options,
|
||||
]
|
||||
],
|
||||
)
|
||||
|
||||
copy_binary = custom_target(
|
||||
custom_target(
|
||||
'cp-binary',
|
||||
depends: cargo_build,
|
||||
build_by_default: true,
|
||||
|
|
@ -61,14 +58,15 @@ copy_binary = custom_target(
|
|||
],
|
||||
)
|
||||
|
||||
cargo_doc = custom_target(
|
||||
custom_target(
|
||||
'cargo-doc',
|
||||
build_by_default: false,
|
||||
build_always_stale: true,
|
||||
output: 'doc',
|
||||
console: true,
|
||||
command: [
|
||||
cargo, 'doc',
|
||||
cargo,
|
||||
'doc',
|
||||
cargo_options + ['--no-deps', '--document-private-items'],
|
||||
],
|
||||
)
|
||||
|
|
@ -84,4 +82,4 @@ test(
|
|||
],
|
||||
is_parallel: false,
|
||||
timeout: 1800,
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue