2022-08-05 00:30:15 -04:00
|
|
|
build_root = meson.project_build_root()
|
|
|
|
|
source_root = meson.project_source_root()
|
|
|
|
|
|
2024-07-17 13:28:14 +02:00
|
|
|
cargo_options = ['--manifest-path', source_root / 'Cargo.toml']
|
|
|
|
|
cargo_options += ['--target-dir', build_root / 'src']
|
2022-08-05 00:13:59 -04:00
|
|
|
|
2023-03-01 08:42:22 -05:00
|
|
|
if get_option('profile') == 'development'
|
|
|
|
|
rust_target = 'debug'
|
|
|
|
|
message('Building in debug mode')
|
|
|
|
|
else
|
2024-07-17 13:28:14 +02:00
|
|
|
cargo_options += ['--release']
|
2022-08-05 00:13:59 -04:00
|
|
|
rust_target = 'release'
|
|
|
|
|
message('Building in release mode')
|
|
|
|
|
endif
|
2020-12-26 02:05:34 -08:00
|
|
|
|
2023-11-30 21:27:52 +01:00
|
|
|
if gtk4_x11.found()
|
2024-07-17 13:28:14 +02:00
|
|
|
cargo_options += ['--features', 'x11']
|
2023-11-30 21:27:52 +01:00
|
|
|
endif
|
|
|
|
|
|
2024-09-27 20:52:07 +02:00
|
|
|
cargo_env = {
|
|
|
|
|
'CARGO_HOME': build_root / 'cargo-home',
|
|
|
|
|
'APP_ID': app_id,
|
|
|
|
|
'PROFILE': profile,
|
|
|
|
|
'VERSION': version,
|
|
|
|
|
'LOCALEDIR': localedir,
|
|
|
|
|
}
|
2020-12-26 02:05:34 -08:00
|
|
|
|
2022-11-07 16:19:27 +01:00
|
|
|
cargo_build = custom_target(
|
2020-12-26 02:05:34 -08:00
|
|
|
'cargo-build',
|
|
|
|
|
build_by_default: true,
|
2022-08-05 00:13:59 -04:00
|
|
|
build_always_stale: true,
|
2022-11-07 16:19:27 +01:00
|
|
|
output: 'src',
|
2020-12-26 02:05:34 -08:00
|
|
|
console: true,
|
2022-11-07 16:19:27 +01:00
|
|
|
env: cargo_env,
|
2020-12-26 02:05:34 -08:00
|
|
|
command: [
|
2024-07-17 13:28:14 +02:00
|
|
|
cargo,
|
|
|
|
|
'build',
|
2022-08-05 00:13:59 -04:00
|
|
|
cargo_options,
|
2024-07-17 13:28:14 +02:00
|
|
|
],
|
2020-12-26 02:05:34 -08:00
|
|
|
)
|
2022-11-07 16:19:27 +01:00
|
|
|
|
2024-07-17 13:28:14 +02:00
|
|
|
custom_target(
|
2022-11-07 16:19:27 +01:00
|
|
|
'cp-binary',
|
|
|
|
|
depends: cargo_build,
|
|
|
|
|
build_by_default: true,
|
|
|
|
|
build_always_stale: true,
|
|
|
|
|
install: true,
|
|
|
|
|
install_dir: get_option('bindir'),
|
|
|
|
|
output: meson.project_name(),
|
|
|
|
|
command: [
|
|
|
|
|
'cp',
|
|
|
|
|
'src' / rust_target / meson.project_name(),
|
|
|
|
|
'@OUTPUT@',
|
|
|
|
|
],
|
|
|
|
|
)
|
2023-01-26 02:27:05 +01:00
|
|
|
|
2024-07-17 13:28:14 +02:00
|
|
|
custom_target(
|
2023-01-26 02:27:05 +01:00
|
|
|
'cargo-doc',
|
|
|
|
|
build_by_default: false,
|
|
|
|
|
build_always_stale: true,
|
|
|
|
|
output: 'doc',
|
|
|
|
|
console: true,
|
|
|
|
|
command: [
|
2024-07-17 13:28:14 +02:00
|
|
|
cargo,
|
|
|
|
|
'doc',
|
2023-01-26 02:27:05 +01:00
|
|
|
cargo_options + ['--no-deps', '--document-private-items'],
|
|
|
|
|
],
|
decoder: Use image-rs, libheif-rs, librsvg
This adds proper support for a lot of image formats including SVGs.
It will be the basis for many features to come. The technical core
is an asynchronous renderer that can arrange textures in smaller tiles
which might be generated on demand.
Closes #34, #40, #41, #49
Basis for fixing the following issues #7, #27, #36, #43, #68, #71
2023-03-04 03:14:52 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
test(
|
|
|
|
|
'cargo-test',
|
|
|
|
|
cargo,
|
|
|
|
|
args: [
|
|
|
|
|
'test',
|
|
|
|
|
cargo_options,
|
|
|
|
|
'--',
|
|
|
|
|
'--test-threads=1',
|
|
|
|
|
],
|
|
|
|
|
is_parallel: false,
|
|
|
|
|
timeout: 1800,
|
2024-07-17 13:28:14 +02:00
|
|
|
)
|