From fda2fbd33084a388effc844ab73fd4f2c297efb1 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 5 Mar 2020 15:44:46 +0000 Subject: [PATCH] build: Add -Dui option to Meson MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows the UI components (libmalcontent-ui and malcontent-control) to be disabled in the build so that a dependency cycle with flatpak can be avoided (by building malcontent twice, once with `-Dui=disabled` and then again with `-Dui=enabled`). The dependency graph is: malcontent-control → libmalcontent-ui → flatpak → libmalcontent which becomes cyclic if libmalcontent-ui and libmalcontent can only be built at the same time. Signed-off-by: Philip Withnall Fixes: #16 --- meson.build | 8 ++++++-- meson_options.txt | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 8ef161a..bb9091b 100644 --- a/meson.build +++ b/meson.build @@ -127,9 +127,13 @@ test_env = [ subdir('accounts-service') subdir('libmalcontent') -subdir('libmalcontent-ui') +if get_option('ui').enabled() + subdir('libmalcontent-ui') +endif subdir('malcontent-client') -subdir('malcontent-control') +if get_option('ui').enabled() + subdir('malcontent-control') +endif subdir('pam') subdir('po') diff --git a/meson_options.txt b/meson_options.txt index 06329d4..9d32658 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -9,3 +9,9 @@ option( type: 'string', description: 'directory for PAM modules' ) +option( + 'ui', + type: 'feature', + value: 'enabled', + description: 'enable UI library' +)