build: Remove 'enable' prefix from option names

Meson options are typed, so the prefix isn't necessary, and indeed
looks odd when used to disable the option:
 -Denable_foo=false

Also replace underscores with dashes, which is the preferred meson
style.

https://bugzilla.gnome.org/show_bug.cgi?id=791007
This commit is contained in:
Florian Müllner 2017-11-25 07:10:26 +01:00
parent ecd9fba514
commit 10c602fe95
2 changed files with 10 additions and 12 deletions

View File

@ -102,7 +102,7 @@ if enable_recorder
endif endif
nm_deps = [] nm_deps = []
enable_networkmanager = get_option('enable-networkmanager') enable_networkmanager = get_option('networkmanager')
if enable_networkmanager != 'no' if enable_networkmanager != 'no'
want_networkmanager = enable_networkmanager == 'yes' want_networkmanager = enable_networkmanager == 'yes'
@ -131,7 +131,7 @@ else
have_networkmanager = false have_networkmanager = false
endif endif
enable_systemd = get_option('enable-systemd') enable_systemd = get_option('systemd')
if enable_systemd != 'no' if enable_systemd != 'no'
want_systemd = enable_systemd == 'yes' want_systemd = enable_systemd == 'yes'
systemd_dep = dependency('libsystemd', required: want_systemd) systemd_dep = dependency('libsystemd', required: want_systemd)
@ -141,15 +141,13 @@ else
have_systemd = false have_systemd = false
endif endif
enable_plugin = get_option('enable-browser-plugin') if get_option('browser_plugin')
if enable_plugin
json_glib_dep = dependency('json-glib-1.0', version: json_glib_req) json_glib_dep = dependency('json-glib-1.0', version: json_glib_req)
subdir('browser-plugin') subdir('browser-plugin')
endif endif
enable_man = get_option('enable-man') if get_option('man')
if enable_man
xsltproc = find_program('xsltproc') xsltproc = find_program('xsltproc')
subdir('man') subdir('man')
@ -204,6 +202,6 @@ subdir('po')
subdir('data') subdir('data')
subdir('tests') subdir('tests')
if get_option('enable-documentation') if get_option('gtk_doc')
subdir('docs/reference') subdir('docs/reference')
endif endif

View File

@ -1,29 +1,29 @@
option('enable-browser-plugin', option('browser_plugin',
type: 'boolean', type: 'boolean',
value: true, value: true,
description: 'Enable extensions.gnome.org browser plugin' description: 'Enable extensions.gnome.org browser plugin'
) )
option('enable-documentation', option('gtk_doc',
type: 'boolean', type: 'boolean',
value: false, value: false,
description: 'Build API reference' description: 'Build API reference'
) )
option('enable-man', option('man',
type: 'boolean', type: 'boolean',
value: true, value: true,
description: 'Generate man pages' description: 'Generate man pages'
) )
option('enable-networkmanager', option('networkmanager',
type: 'combo', type: 'combo',
choices: ['yes', 'no', 'auto'], choices: ['yes', 'no', 'auto'],
value: 'auto', value: 'auto',
description: 'Enable NetworkManager support' description: 'Enable NetworkManager support'
) )
option('enable-systemd', option('systemd',
type: 'combo', type: 'combo',
choices: ['yes', 'no', 'auto'], choices: ['yes', 'no', 'auto'],
value: 'auto', value: 'auto',