From 8f9b2bc3b60f59ecc9e6193764fa885cdef7f0ce Mon Sep 17 00:00:00 2001 From: Konrad Dybcio Date: Tue, 9 Apr 2024 19:45:49 +0200 Subject: [PATCH] meson.build: Make building qrtr-ns opt-in It's been moved to the kernel since forever.. Signed-off-by: Konrad Dybcio --- meson.build | 3 ++- meson_options.txt | 6 ++++++ src/meson.build | 24 +++++++++++++----------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index 5d047b4..4478263 100644 --- a/meson.build +++ b/meson.build @@ -9,6 +9,7 @@ project('qrtr', ]) prefix = get_option('prefix') +with_qrtr_ns = get_option('qrtr-ns') install_systemd_unit = get_option('systemd-service') systemd = dependency('systemd', required : install_systemd_unit) @@ -29,7 +30,7 @@ subdir('lib') subdir('include') subdir('src') -if systemd.found() +if systemd.found() and with_qrtr_ns.enabled() systemd_unit_conf = configuration_data() systemd_unit_conf.set('prefix', prefix) configure_file( diff --git a/meson_options.txt b/meson_options.txt index bd264c7..5c8fb59 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,9 @@ +option('qrtr-ns', + type: 'feature', + value: 'auto', + description: 'Whether or not to build the qrtr-ns binary' +) + option('systemd-unit-prefix', type: 'string', description: 'Directory for systemd system unit files' diff --git a/src/meson.build b/src/meson.build index ee25203..960cb11 100644 --- a/src/meson.build +++ b/src/meson.build @@ -9,17 +9,19 @@ executable('qrtr-cfg', include_directories : inc, install : true) -ns_srcs = ['addr.c', - 'hash.c', - 'map.c', - 'ns.c', - 'util.c', - 'waiter.c'] -executable('qrtr-ns', - ns_srcs, - link_with : libqrtr, - include_directories : inc, - install : true) +if with_qrtr_ns.enabled() + ns_srcs = ['addr.c', + 'hash.c', + 'map.c', + 'ns.c', + 'util.c', + 'waiter.c'] + executable('qrtr-ns', + ns_srcs, + link_with : libqrtr, + include_directories : inc, + install : true) +endif executable('qrtr-lookup', 'lookup.c',