2024-10-15 20:51:13 +00:00
|
|
|
project(
|
|
|
|
'audrey',
|
2024-10-29 12:19:12 +00:00
|
|
|
['c', 'vala'],
|
2024-10-15 20:51:13 +00:00
|
|
|
version: '0.1.0', # AUDREY_VERSION
|
|
|
|
meson_version: '>= 1.0.0',
|
|
|
|
default_options: ['warning_level=0', 'werror=false'],
|
2024-10-06 11:21:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
i18n = import('i18n')
|
|
|
|
gnome = import('gnome')
|
2024-10-29 10:37:15 +00:00
|
|
|
fs = import('fs')
|
2024-10-15 21:02:48 +00:00
|
|
|
cc = meson.get_compiler('c')
|
2024-10-29 12:19:12 +00:00
|
|
|
valac = meson.get_compiler('vala')
|
2024-10-06 11:21:53 +00:00
|
|
|
|
|
|
|
srcdir = meson.project_source_root() / 'src'
|
|
|
|
|
|
|
|
config_h = configuration_data()
|
2024-10-15 20:51:13 +00:00
|
|
|
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
|
2024-10-12 20:52:29 +00:00
|
|
|
config_h.set_quoted('GETTEXT_PACKAGE', 'audrey')
|
2024-10-06 11:21:53 +00:00
|
|
|
config_h.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir'))
|
|
|
|
configure_file(output: 'config.h', configuration: config_h)
|
|
|
|
|
2024-10-29 12:19:12 +00:00
|
|
|
config_dep = valac.find_library('config', dirs: srcdir)
|
2024-10-06 11:21:53 +00:00
|
|
|
config_inc = include_directories('.')
|
|
|
|
|
2024-10-15 20:51:13 +00:00
|
|
|
add_project_arguments(
|
2024-10-18 08:56:56 +00:00
|
|
|
[
|
|
|
|
'-DGETTEXT_PACKAGE="' + meson.project_name() + '"',
|
|
|
|
'-DG_LOG_DOMAIN="audrey"',
|
|
|
|
],
|
2024-10-15 20:51:13 +00:00
|
|
|
language: 'c',
|
|
|
|
)
|
2024-10-06 11:21:53 +00:00
|
|
|
|
2024-10-15 21:02:48 +00:00
|
|
|
add_project_arguments(
|
2024-10-18 00:39:17 +00:00
|
|
|
cc.get_supported_arguments(
|
|
|
|
['-Wno-tautological-pointer-compare', '-Wno-unused-value'],
|
|
|
|
),
|
2024-10-15 21:02:48 +00:00
|
|
|
language: 'c',
|
|
|
|
)
|
|
|
|
|
2024-10-06 11:21:53 +00:00
|
|
|
subdir('data')
|
|
|
|
subdir('po')
|
2024-10-29 10:46:58 +00:00
|
|
|
subdir('resources')
|
|
|
|
subdir('src')
|
2024-10-06 11:21:53 +00:00
|
|
|
|
2024-10-29 18:13:49 +00:00
|
|
|
if get_option('buildtype') == 'debug'
|
|
|
|
rust_args = []
|
|
|
|
rust_target = 'debug'
|
|
|
|
else
|
|
|
|
rust_args = ['--release']
|
|
|
|
rust_target = 'release'
|
|
|
|
endif
|
|
|
|
|
2024-10-29 10:37:15 +00:00
|
|
|
cargo = find_program('cargo')
|
|
|
|
custom_target(
|
|
|
|
'cargo-build',
|
|
|
|
build_by_default: true,
|
|
|
|
build_always_stale: true,
|
2024-10-29 10:46:58 +00:00
|
|
|
depends: [
|
|
|
|
audrey_c,
|
|
|
|
blueprints,
|
|
|
|
],
|
2024-10-29 18:13:49 +00:00
|
|
|
console: true,
|
2024-10-29 10:37:15 +00:00
|
|
|
output: meson.project_name(),
|
|
|
|
command: [
|
|
|
|
'env',
|
|
|
|
'RUSTFLAGS=-L ' + fs.parent(audrey_c.full_path()),
|
2024-10-29 10:46:58 +00:00
|
|
|
'MESON_BUILD_ROOT=' + meson.project_build_root(),
|
2024-10-29 10:37:15 +00:00
|
|
|
cargo,
|
|
|
|
'build',
|
2024-10-29 18:13:49 +00:00
|
|
|
rust_args,
|
2024-10-29 10:37:15 +00:00
|
|
|
'--manifest-path', meson.project_source_root() / 'Cargo.toml',
|
|
|
|
'--target-dir', meson.project_build_root() / 'cargo-target',
|
|
|
|
'&&',
|
|
|
|
'cp',
|
2024-10-29 18:13:49 +00:00
|
|
|
'cargo-target' / rust_target / meson.project_name(),
|
2024-10-29 10:37:15 +00:00
|
|
|
'@OUTPUT@',
|
|
|
|
],
|
2024-10-06 11:21:53 +00:00
|
|
|
)
|