77 lines
1.7 KiB
Meson
77 lines
1.7 KiB
Meson
|
# SPDX-FileCopyrightText: Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||
|
|
||
|
gnome = import('gnome')
|
||
|
gdbus_src = gnome.gdbus_codegen('parentalcontrol-dns',
|
||
|
sources: '../accounts-service/com.endlessm.ParentalControls.Dns.xml',
|
||
|
interface_prefix : 'com.endlessm.',
|
||
|
namespace : '',
|
||
|
)
|
||
|
|
||
|
source_files = [
|
||
|
'cares_init.hh',
|
||
|
'cares_init.cc',
|
||
|
'get_host.hh',
|
||
|
'get_host.cc',
|
||
|
'helpers.hh',
|
||
|
'helpers.cc',
|
||
|
'logger.hh',
|
||
|
'logger.cc',
|
||
|
'nss_adapters.cc',
|
||
|
'resolver.hh',
|
||
|
'resolver.cc',
|
||
|
'user_policy.hh',
|
||
|
'user_policy.cc',
|
||
|
'wrapper.hh',
|
||
|
gdbus_src,
|
||
|
]
|
||
|
|
||
|
standard_args = [
|
||
|
'-Wall',
|
||
|
'-Wextra',
|
||
|
'-pedantic',
|
||
|
]
|
||
|
|
||
|
dependencies = [
|
||
|
dependency('libcares', version: '>= 1.19.1'),
|
||
|
dependency('gio-2.0', version: '>= 2.26'),
|
||
|
]
|
||
|
|
||
|
standards = ['cpp_std=c++20']
|
||
|
|
||
|
shared_library('nss_malcontent',
|
||
|
sources: source_files,
|
||
|
cpp_args: standard_args,
|
||
|
gnu_symbol_visibility: 'hidden',
|
||
|
extra_files: [
|
||
|
'../accounts-service/com.endlessm.ParentalControls.Dns.xml',
|
||
|
'../accounts-service/com.endlessm.ParentalControls.policy.in',
|
||
|
'../accounts-service/com.endlessm.ParentalControls.rules.in',
|
||
|
],
|
||
|
override_options: standards,
|
||
|
soversion: '2',
|
||
|
install: true,
|
||
|
dependencies: dependencies,
|
||
|
)
|
||
|
|
||
|
test_source_files = [
|
||
|
'test_main.cc',
|
||
|
'test_resolver.cc',
|
||
|
'testsuite.hh',
|
||
|
]
|
||
|
|
||
|
nss_tests = executable('nss_malcontent-tests',
|
||
|
sources: source_files + test_source_files,
|
||
|
cpp_args: ['-DNSS_MALCONTENT_TEST'],
|
||
|
override_options : standards,
|
||
|
dependencies: dependencies + [ dependency('glib-2.0', version: '>= 2.74') ])
|
||
|
|
||
|
test('nss_malcontent',
|
||
|
nss_tests,
|
||
|
env: [
|
||
|
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
||
|
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
|
||
|
],
|
||
|
protocol: 'tap',
|
||
|
)
|