From 6125cc3a852680c086a1b962a8c795152ce6a80a Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 5 Mar 2020 22:02:43 +0000 Subject: [PATCH] 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 Fixes: #16 --- meson.build | 9 ++++++++- meson_options.txt | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index bb9091b..9b2d44b 100644 --- a/meson.build +++ b/meson.build @@ -126,7 +126,14 @@ test_env = [ ] 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() subdir('libmalcontent-ui') endif diff --git a/meson_options.txt b/meson_options.txt index 9d32658..d516c70 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -15,3 +15,9 @@ option( value: 'enabled', 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' +)