2020-12-26 02:05:34 -08:00
|
|
|
configure_file(
|
|
|
|
|
input: 'config.rs.in',
|
|
|
|
|
output: 'config.rs',
|
|
|
|
|
configuration: conf
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Copy the config.rs output to the source directory.
|
|
|
|
|
run_command(
|
|
|
|
|
'cp',
|
|
|
|
|
join_paths(meson.build_root(), 'src', 'config.rs'),
|
|
|
|
|
join_paths(meson.source_root(), 'src', 'config.rs'),
|
|
|
|
|
check: true
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
rust_sources = files(
|
|
|
|
|
'widgets/image_view.rs',
|
2021-12-13 18:19:23 -08:00
|
|
|
'widgets/image.rs',
|
2020-12-26 02:05:34 -08:00
|
|
|
'widgets/mod.rs',
|
|
|
|
|
'application.rs',
|
|
|
|
|
'config.rs',
|
|
|
|
|
'main.rs',
|
2021-09-05 05:51:34 -07:00
|
|
|
'util.rs',
|
2020-12-26 02:05:34 -08:00
|
|
|
'window.rs',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
sources = [cargo_sources, rust_sources]
|
|
|
|
|
|
|
|
|
|
cargo_script = find_program(join_paths(meson.source_root(), 'build-aux/cargo.sh'))
|
|
|
|
|
cargo_release = custom_target(
|
|
|
|
|
'cargo-build',
|
|
|
|
|
build_by_default: true,
|
|
|
|
|
input: sources,
|
|
|
|
|
output: meson.project_name(),
|
|
|
|
|
console: true,
|
|
|
|
|
install: true,
|
|
|
|
|
install_dir: get_option('bindir'),
|
|
|
|
|
command: [
|
|
|
|
|
cargo_script,
|
|
|
|
|
meson.build_root(),
|
|
|
|
|
meson.source_root(),
|
|
|
|
|
'@OUTPUT@',
|
|
|
|
|
get_option('buildtype'),
|
|
|
|
|
meson.project_name(),
|
|
|
|
|
]
|
|
|
|
|
)
|