From 753c5276cf800ae1fb1c7747bfcdaeff5e45d6de Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 7 Apr 2021 14:30:04 +0200 Subject: build: don't allow "auto" for seatd, builtin, server and examples These features don't have any dependencies, so "auto" doesn't make sense. --- meson.build | 19 ++++++++++++------- meson_options.txt | 8 ++++---- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index 60c96f0..722735a 100644 --- a/meson.build +++ b/meson.build @@ -102,7 +102,11 @@ server_files = [ 'seatd/server.c', ] -if get_option('seatd').enabled() +with_seatd = get_option('seatd') == 'enabled' +with_builtin = get_option('builtin') == 'enabled' +with_server = get_option('server') == 'enabled' + +if with_seatd private_files += 'libseat/backend/seatd.c' add_project_arguments('-DSEATD_ENABLED=1', language: 'c') endif @@ -134,7 +138,7 @@ if get_option('logind') != 'disabled' endif endif -if get_option('builtin').enabled() +if with_builtin add_project_arguments('-DBUILTIN_ENABLED=1', language: 'c') private_files += server_files endif @@ -175,7 +179,7 @@ libseat = declare_dependency( include_directories: include_directories('include', is_system: true), ) -if get_option('server').enabled() +if with_server executable( 'seatd', [ server_files, 'seatd/seatd.c' ], @@ -184,7 +188,7 @@ if get_option('server').enabled() ) endif -if get_option('examples').enabled() +if get_option('examples') == 'enabled' executable( 'simpletest', ['examples/simpletest/main.c'], @@ -207,7 +211,7 @@ foreach name, value : tests include_directories: [include_directories('.', 'include')])) endforeach -if get_option('server').enabled() +if with_server scdoc = dependency('scdoc', required: get_option('man-pages'), version: '>= 1.9.7', native: true) else scdoc = disabler() @@ -236,8 +240,9 @@ if scdoc.found() endif summary({ - 'seatd': get_option('seatd').enabled(), - 'builtin': get_option('builtin').enabled(), + 'seatd': with_seatd, + 'builtin': with_builtin, + 'server': with_server, 'systemd': logind.found() and logind_provider == 'systemd', 'elogind': logind.found() and logind_provider == 'elogind', }, bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 9c36fa3..144ce7a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,7 +1,7 @@ option('logind', type: 'combo', choices: ['auto', 'disabled', 'elogind', 'systemd'], value: 'auto', description: 'logind support') -option('seatd', type: 'feature', value: 'enabled', description: 'seatd support') -option('builtin', type: 'feature', value: 'disabled', description: 'builtin seatd server') -option('server', type: 'feature', value: 'enabled', description: 'seatd server') -option('examples', type: 'feature', value: 'disabled', description: 'libseat example programs') +option('seatd', type: 'combo', choices: ['enabled', 'disabled'], value: 'enabled', description: 'seatd support') +option('builtin', type: 'combo', choices: ['enabled', 'disabled'], value: 'disabled', description: 'builtin seatd server') +option('server', type: 'combo', choices: ['enabled', 'disabled'], value: 'enabled', description: 'seatd server') +option('examples', type: 'combo', choices: ['enabled', 'disabled'], value: 'disabled', description: 'libseat example programs') option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages') option('defaultpath', type: 'string', value: '', description: 'Default location for seatd socket (empty for default)') -- cgit v1.2.3