Loupe/src/meson.build
Sophie Herold f80ec7db56 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 21:48:51 -05:00

83 lines
1.6 KiB
Meson

configure_file(
input: 'config.rs.in',
output: 'config.rs',
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',
build_root / 'src' / 'config.rs',
source_root / 'src' / 'config.rs',
check: true
)
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' ]
rust_target = 'release'
message('Building in release mode')
endif
cargo_env = { 'CARGO_HOME': build_root / 'cargo-home' }
cargo_build = custom_target(
'cargo-build',
build_by_default: true,
build_always_stale: true,
output: 'src',
console: true,
env: cargo_env,
command: [
cargo, 'build',
cargo_options,
]
)
copy_binary = custom_target(
'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@',
],
)
cargo_doc = custom_target(
'cargo-doc',
build_by_default: false,
build_always_stale: true,
output: 'doc',
console: true,
command: [
cargo, 'doc',
cargo_options + ['--no-deps', '--document-private-items'],
],
)
test(
'cargo-test',
cargo,
args: [
'test',
cargo_options,
'--',
'--test-threads=1',
],
is_parallel: false,
timeout: 1800,
)