malcontent/meson.build

166 lines
4.6 KiB
Meson
Raw Normal View History

2024-01-05 18:10:45 +01:00
project('malcontent', 'c', 'cpp',
version : '0.12.0',
meson_version : '>= 0.59.0',
license: ['LGPL-2.1-or-later', 'GPL-2.0-or-later'],
default_options : [
'buildtype=debugoptimized',
'warning_level=2',
'c_std=gnu11',
]
)
2024-01-05 18:10:45 +01:00
if get_option('buildtype') in ['debugoptimized', 'debug']
add_project_arguments('-g3', language : ['c', 'cpp'])
endif
gnome = import('gnome')
i18n = import('i18n')
pkgconfig = import('pkgconfig')
meson_make_symlink = join_paths(meson.current_source_dir(), 'tools', 'meson-make-symlink.py')
po_dir = join_paths(meson.current_source_dir(), 'po')
prefix = get_option('prefix')
bindir = join_paths(prefix, get_option('bindir'))
datadir = join_paths(prefix, get_option('datadir'))
libdir = join_paths(prefix, get_option('libdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
includedir = join_paths(prefix, get_option('includedir'))
# FIXME: This isnt exposed in accountsservice.pc
# See https://gitlab.freedesktop.org/accountsservice/accountsservice/merge_requests/16
accountsserviceinterfacesdir = join_paths(datadir, 'accountsservice', 'interfaces')
# FIXME: pam.pc doesnt exist
pamlibdir = get_option('pamlibdir')
if pamlibdir == ''
pamlibdir = join_paths(libdir, 'security')
endif
dbus = dependency('dbus-1')
dbusinterfacesdir = dbus.get_variable(pkgconfig: 'interfaces_dir',
pkgconfig_define: ['datadir', datadir])
polkit_gobject = dependency('polkit-gobject-1')
polkitpolicydir = polkit_gobject.get_variable(pkgconfig: 'policydir',
pkgconfig_define: ['prefix', prefix])
config_h = configuration_data()
config_h.set_quoted('GETTEXT_PACKAGE', 'malcontent')
config_h.set_quoted('PACKAGE_LOCALE_DIR', join_paths(get_option('prefix'), get_option('localedir')))
config_h.set_quoted('PAMLIBDIR', pamlibdir)
config_h.set_quoted('VERSION', meson.project_version())
configure_file(
output: 'config.h',
configuration: config_h,
)
root_inc = include_directories('.')
# Enable warning flags
test_c_args = [
'-fno-strict-aliasing',
'-fstack-protector-strong',
'-Waggregate-return',
'-Wall',
'-Wunused',
'-Warray-bounds',
'-Wcast-align',
'-Wclobbered',
'-Wno-declaration-after-statement',
'-Wdiscarded-qualifiers',
'-Wduplicated-branches',
'-Wduplicated-cond',
'-Wempty-body',
'-Wformat=2',
'-Wformat-nonliteral',
'-Wformat-security',
'-Wformat-signedness',
'-Wignored-qualifiers',
'-Wimplicit-function-declaration',
'-Wincompatible-pointer-types',
'-Wincompatible-pointer-types-discards-qualifiers',
'-Winit-self',
'-Wint-conversion',
'-Wlogical-op',
'-Wmisleading-indentation',
'-Wmissing-declarations',
'-Wmissing-format-attribute',
'-Wmissing-include-dirs',
'-Wmissing-noreturn',
'-Wmissing-parameter-type',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wno-error=cpp',
'-Wmissing-field-initializers',
'-Wno-suggest-attribute=format',
'-Wno-unused-parameter',
'-Wnull-dereference',
'-Wold-style-definition',
'-Woverflow',
'-Woverride-init',
'-Wparentheses',
'-Wpointer-arith',
'-Wredundant-decls',
'-Wreturn-type',
'-Wshadow',
'-Wsign-compare',
'-Wstrict-aliasing=2',
'-Wstrict-prototypes',
'-Wswitch-default',
'-Wswitch-enum',
'-Wtype-limits',
'-Wundef',
'-Wuninitialized',
'-Wunused-but-set-variable',
'-Wunused-result',
'-Wunused-variable',
'-Wwrite-strings'
]
cc = meson.get_compiler('c')
add_project_arguments(cc.get_supported_arguments(test_c_args), language: 'c')
enable_installed_tests = get_option('installed_tests')
test_template = files('template.test.in')
test_env = [
'G_DEBUG=gc-friendly,fatal-warnings',
'MALLOC_CHECK_=2',
'LC_ALL=C.UTF-8',
]
subdir('accounts-service')
subdir('help')
if not get_option('use_system_libmalcontent')
subdir('libmalcontent')
else
libmalcontent_api_version = '0'
libmalcontent_dep = dependency('malcontent-' + libmalcontent_api_version, version: meson.project_version())
libmalcontent_gir = ['Malcontent-' + libmalcontent_api_version,
'Malcontent-' + libmalcontent_api_version + '.typelib']
endif
if get_option('ui').enabled()
gtk_dep = dependency('gtk4', version: '>= 4.6')
libadwaita_dep = dependency(
'libadwaita-1',
version: '>= 1.1',
fallback: ['libadwaita', 'libadwaita_dep'],
default_options: ['examples=false', 'introspection=disabled', 'tests=false', 'vapi=false'],
)
subdir('libmalcontent-ui')
endif
subdir('malcontent-client')
if get_option('ui').enabled()
subdir('malcontent-control')
gnome.post_install(
gtk_update_icon_cache: true,
update_desktop_database: true,
)
endif
2024-01-05 18:10:45 +01:00
if get_option('nss').enabled()
subdir('nss')
endif
subdir('pam')
subdir('po')