From f66a5d55201ad2761c7edfe9fb07eea42e15265e Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 7 Feb 2019 14:46:16 +0000 Subject: Allow building without the daemon This is useful for flathub. --- meson.build | 14 ++++++++++---- meson_options.txt | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 83e6b7d..7443ca1 100644 --- a/meson.build +++ b/meson.build @@ -180,19 +180,23 @@ if get_option('reverse') conf.set('CD_BUILD_REVERSE', '1') endif +if get_option('daemon') conf.set_quoted('DAEMON_USER', get_option('daemon_user')) if get_option('daemon_user') == 'root' warning('RUNNING THE DAEMON AS root IS NOT A GOOD IDEA, use -Ddaemon_user= to set user') endif +endif if get_option('pnp_ids') != '' conf.set_quoted('PNP_IDS', get_option('pnp_ids')) endif +if get_option('daemon') polkit = dependency('polkit-gobject-1', version : '>= 0.103') if polkit.version().version_compare('>= 0.114') conf.set('POLKIT_HAS_AUTOPTR_MACROS', '1') endif +endif if meson.version().version_compare('>0.41.0') valgrind = dependency('valgrind', required: false) @@ -262,11 +266,13 @@ subdir('data') if get_option('man') subdir('man') endif -subdir('policy') -if get_option('udev_rules') - subdir('rules') +if get_option('daemon') + if get_option('udev_rules') + subdir('rules') + endif + subdir('policy') + subdir('src') endif -subdir('src') meson.add_install_script('meson_post_install.sh', localstatedir, get_option('daemon_user')) diff --git a/meson_options.txt b/meson_options.txt index fde9ae6..52af113 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,4 @@ +option('daemon', type : 'boolean', value : true, description : 'build the daemon') option('session_example', type : 'boolean', value : false, description : 'Enable session example') option('bash_completion', type : 'boolean', value : true, description : 'Enable bash completion') option('udev_rules', type: 'boolean', value: true, description: 'Install udev rules') -- cgit v1.2.1