summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2019-02-07 14:46:16 +0000
committerRichard Hughes <richard@hughsie.com>2019-02-07 14:46:16 +0000
commitf66a5d55201ad2761c7edfe9fb07eea42e15265e (patch)
tree2116120af16234b21b62b688097dc4cecbca67f5
parent40899d80ddc0ec5c7dccbd7e19222ace97607368 (diff)
downloadcolord-wip/hughsie/daemon.tar.gz
Allow building without the daemonwip/hughsie/daemon
This is useful for flathub.
-rw-r--r--meson.build14
-rw-r--r--meson_options.txt1
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')