build: Add an option to build against libmalcontent from the system

Rather than building it again; this is the second half of resolving the
dependency cycle from the previous commit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #16
This commit is contained in:
Philip Withnall 2020-03-05 22:02:43 +00:00
parent fda2fbd330
commit 6125cc3a85
2 changed files with 14 additions and 1 deletions

View File

@ -126,7 +126,14 @@ test_env = [
] ]
subdir('accounts-service') subdir('accounts-service')
subdir('libmalcontent') 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() if get_option('ui').enabled()
subdir('libmalcontent-ui') subdir('libmalcontent-ui')
endif endif

View File

@ -15,3 +15,9 @@ option(
value: 'enabled', value: 'enabled',
description: 'enable UI library' description: 'enable UI library'
) )
option(
'use_system_libmalcontent',
type: 'boolean',
value: false,
description: 'use installed libmalcontent rather than building it; used in distros to break a dependency cycle'
)