mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-27 04:07:25 +01:00
Initial commit
This commit is contained in:
parent
9969fb065e
commit
9969ebcfd7
25 changed files with 2250 additions and 0 deletions
56
src/meson.build
Normal file
56
src/meson.build
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
|
||||
gnome = import('gnome')
|
||||
|
||||
gnome.compile_resources('musicus',
|
||||
'musicus.gresource.xml',
|
||||
gresource_bundle: true,
|
||||
install: true,
|
||||
install_dir: pkgdatadir,
|
||||
)
|
||||
|
||||
conf = configuration_data()
|
||||
conf.set_quoted('VERSION', meson.project_version())
|
||||
conf.set_quoted('GETTEXT_PACKAGE', 'musicus')
|
||||
conf.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
|
||||
conf.set_quoted('PKGDATADIR', pkgdatadir)
|
||||
|
||||
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.project_build_root(), 'src', 'config.rs'),
|
||||
join_paths(meson.project_source_root(), 'src', 'config.rs'),
|
||||
check: true
|
||||
)
|
||||
|
||||
cargo_bin = find_program('cargo')
|
||||
cargo_opt = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ]
|
||||
cargo_opt += [ '--target-dir', meson.project_build_root() / 'src' ]
|
||||
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
|
||||
|
||||
if get_option('buildtype') == 'release'
|
||||
cargo_options += [ '--release' ]
|
||||
rust_target = 'release'
|
||||
else
|
||||
rust_target = 'debug'
|
||||
endif
|
||||
|
||||
cargo_build = custom_target(
|
||||
'cargo-build',
|
||||
build_by_default: true,
|
||||
build_always_stale: true,
|
||||
output: meson.project_name(),
|
||||
console: true,
|
||||
install: true,
|
||||
install_dir: get_option('bindir'),
|
||||
command: [
|
||||
'env', cargo_env,
|
||||
cargo_bin, 'build',
|
||||
cargo_opt, '&&', 'cp', 'src' / rust_target / meson.project_name(), '@OUTPUT@',
|
||||
]
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue