meson: Use [ true, false, auto ] for tristate values

For symmetry with the boolean options. I really do not want to care
whether an option is a tristate if I'm trying to set it explicitly.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Adam Jackson 2017-10-24 13:03:09 -04:00
parent c2c6e9e68a
commit 04163fe8c6
2 changed files with 35 additions and 35 deletions

View File

@ -76,9 +76,9 @@ compositeproto_dep = dependency('compositeproto', version: '>= 0.4')
recordproto_dep = dependency('recordproto', version: '>= 1.13.99.1') recordproto_dep = dependency('recordproto', version: '>= 1.13.99.1')
scrnsaverproto_dep = dependency('scrnsaverproto', version: '>= 1.1') scrnsaverproto_dep = dependency('scrnsaverproto', version: '>= 1.1')
resourceproto_dep = dependency('resourceproto', version: '>= 1.2.0') resourceproto_dep = dependency('resourceproto', version: '>= 1.2.0')
xf86driproto_dep = dependency('xf86driproto', version: '>= 2.1.0', required: get_option('dri1') == 'yes') xf86driproto_dep = dependency('xf86driproto', version: '>= 2.1.0', required: get_option('dri1') == 'true')
dri2proto_dep = dependency('dri2proto', version: '>= 2.8', required: get_option('dri2') == 'yes') dri2proto_dep = dependency('dri2proto', version: '>= 2.8', required: get_option('dri2') == 'true')
dri3proto_dep = dependency('dri3proto', version: '>= 1.0', required: get_option('dri3') == 'yes') dri3proto_dep = dependency('dri3proto', version: '>= 1.0', required: get_option('dri3') == 'true')
xineramaproto_dep = dependency('xineramaproto') xineramaproto_dep = dependency('xineramaproto')
xf86bigfontproto_dep = dependency('xf86bigfontproto', version: '>= 1.2.0') xf86bigfontproto_dep = dependency('xf86bigfontproto', version: '>= 1.2.0')
xf86dgaproto_dep = dependency('xf86dgaproto', version: '>= 2.0.99.1', required: false) xf86dgaproto_dep = dependency('xf86dgaproto', version: '>= 2.0.99.1', required: false)
@ -93,7 +93,7 @@ xkbfile_dep = dependency('xkbfile')
xfont2_dep = dependency('xfont2', version: '>= 2.0') xfont2_dep = dependency('xfont2', version: '>= 2.0')
nettle_dep = dependency('nettle') nettle_dep = dependency('nettle')
dbus_required = get_option('systemd_logind') == 'yes' dbus_required = get_option('systemd_logind') == 'true'
dbus_dep = dependency('dbus-1', version: '>= 1.0', required: dbus_required) dbus_dep = dependency('dbus-1', version: '>= 1.0', required: dbus_required)
# Resolve default values of some options # Resolve default values of some options
@ -118,13 +118,13 @@ glamor_option = get_option('glamor')
build_udev = get_option('udev') build_udev = get_option('udev')
if host_machine.system() == 'windows' if host_machine.system() == 'windows'
build_udev = false build_udev = false
hal_option = 'no' hal_option = 'false'
endif endif
if get_option('systemd_logind') == 'auto' if get_option('systemd_logind') == 'auto'
build_systemd_logind = build_udev and dbus_dep.found() build_systemd_logind = build_udev and dbus_dep.found()
else else
build_systemd_logind = get_option('systemd_logind') == 'yes' build_systemd_logind = get_option('systemd_logind') == 'true'
endif endif
build_xorg = false build_xorg = false
@ -134,7 +134,7 @@ if (host_machine.system() != 'darwin' and
build_xorg = (host_machine.system() != 'darwin' and build_xorg = (host_machine.system() != 'darwin' and
host_machine.system() != 'windows') host_machine.system() != 'windows')
else else
build_xorg = get_option('xorg') == 'yes' build_xorg = get_option('xorg') == 'true'
endif endif
endif endif
xorgsdkdir = join_paths(get_option('prefix'), get_option('includedir'), 'xorg') xorgsdkdir = join_paths(get_option('prefix'), get_option('includedir'), 'xorg')
@ -142,8 +142,8 @@ xorgsdkdir = join_paths(get_option('prefix'), get_option('includedir'), 'xorg')
build_xwayland = false build_xwayland = false
if (host_machine.system() != 'darwin' and if (host_machine.system() != 'darwin' and
host_machine.system() != 'windows') host_machine.system() != 'windows')
if get_option('xwayland') != 'no' if get_option('xwayland') != 'false'
xwayland_required = get_option('xwayland') == 'yes' xwayland_required = get_option('xwayland') == 'true'
xwayland_dep = [ xwayland_dep = [
dependency('wayland-client', version: '>= 1.3.0', required: xwayland_required), dependency('wayland-client', version: '>= 1.3.0', required: xwayland_required),
@ -165,8 +165,8 @@ endif
build_xnest = false build_xnest = false
if (host_machine.system() != 'darwin' and if (host_machine.system() != 'darwin' and
host_machine.system() != 'windows') host_machine.system() != 'windows')
if get_option('xnest') != 'no' if get_option('xnest') != 'false'
xnest_required = get_option('xnest') == 'yes' xnest_required = get_option('xnest') == 'true'
xnest_dep = [ xnest_dep = [
dependency('xext', version: '>= 1.0.99.4', required: xnest_required), dependency('xext', version: '>= 1.0.99.4', required: xnest_required),
@ -191,7 +191,7 @@ if get_option('xwin') == 'auto'
build_xwin = true build_xwin = true
endif endif
else else
build_xwin = get_option('xwin') == 'yes' build_xwin = get_option('xwin') == 'true'
endif endif
# XXX: Finish these. # XXX: Finish these.
@ -200,7 +200,7 @@ build_xquartz = false
if get_option('ipv6') == 'auto' if get_option('ipv6') == 'auto'
build_ipv6 = cc.has_function('getaddrinfo') build_ipv6 = cc.has_function('getaddrinfo')
else else
build_ipv6 = get_option('ipv6') == 'yes' build_ipv6 = get_option('ipv6') == 'true'
endif endif
int10 = get_option('int10') int10 = get_option('int10')
@ -223,7 +223,7 @@ if hal_option == 'auto'
build_hal = false build_hal = false
endif endif
else else
build_hal = hal_option == 'yes' build_hal = hal_option == 'true'
if build_hal if build_hal
hal_dep = dependency('hal') hal_dep = dependency('hal')
endif endif
@ -253,7 +253,7 @@ endif
if glamor_option == 'auto' if glamor_option == 'auto'
build_glamor = build_xorg or build_xwayland build_glamor = build_xorg or build_xwayland
else else
build_glamor = get_option('glamor') == 'yes' build_glamor = get_option('glamor') == 'true'
endif endif
gbm_dep = dependency('', required:false) gbm_dep = dependency('', required:false)
@ -274,19 +274,19 @@ build_glx = get_option('glx')
if get_option('dri1') == 'auto' if get_option('dri1') == 'auto'
build_dri1 = xf86driproto_dep.found() build_dri1 = xf86driproto_dep.found()
else else
build_dri1 = get_option('dri1') == 'yes' build_dri1 = get_option('dri1') == 'true'
endif endif
if get_option('dri2') == 'auto' if get_option('dri2') == 'auto'
build_dri2 = dri2proto_dep.found() build_dri2 = dri2proto_dep.found()
else else
build_dri2 = get_option('dri2') == 'yes' build_dri2 = get_option('dri2') == 'true'
endif endif
if get_option('dri3') == 'auto' if get_option('dri3') == 'auto'
build_dri3 = dri3proto_dep.found() and xshmfence_dep.found() build_dri3 = dri3proto_dep.found() and xshmfence_dep.found()
else else
build_dri3 = get_option('dri3') == 'yes' build_dri3 = get_option('dri3') == 'true'
if build_dri3 if build_dri3
if not xshmfence_dep.found() if not xshmfence_dep.found()
error('DRI3 requested, but xshmfence not found') error('DRI3 requested, but xshmfence not found')
@ -294,7 +294,7 @@ else
endif endif
endif endif
libdrm_required = (get_option('dri1') == 'yes') or (get_option('dri2') == 'yes') or (get_option('dri3') == 'yes') libdrm_required = (get_option('dri1') == 'true') or (get_option('dri2') == 'true') or (get_option('dri3') == 'true')
libdrm_dep = dependency('libdrm', version: '>= 2.3.1', required: libdrm_required) libdrm_dep = dependency('libdrm', version: '>= 2.3.1', required: libdrm_required)
build_modesetting = false build_modesetting = false
if libdrm_dep.found() if libdrm_dep.found()
@ -314,7 +314,7 @@ if get_option('vbe') == 'auto'
build_vbe = true build_vbe = true
endif endif
else else
build_vbe = get_option('vbe') == 'yes' build_vbe = get_option('vbe') == 'true'
endif endif
build_vgahw = false build_vgahw = false
@ -325,7 +325,7 @@ if get_option('vgahw') == 'auto'
build_vgahw = true build_vgahw = true
endif endif
else else
build_vgahw = get_option('vgahw') == 'yes' build_vgahw = get_option('vgahw') == 'true'
endif endif
# XXX: Allow configuration of these. # XXX: Allow configuration of these.

View File

@ -1,18 +1,18 @@
option('xorg', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', option('xorg', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable Xorg X Server') description: 'Enable Xorg X Server')
option('xephyr', type: 'boolean', value: false, option('xephyr', type: 'boolean', value: false,
description: 'Enable Xephyr nested X server') description: 'Enable Xephyr nested X server')
option('xwayland', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', option('xwayland', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable XWayland X server') description: 'Enable XWayland X server')
option('glamor', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', option('glamor', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable glamor (default yes for Xorg/Xwayland builds)') description: 'Enable glamor (default yes for Xorg/Xwayland builds)')
option('xnest', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', option('xnest', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable Xnest nested X server') description: 'Enable Xnest nested X server')
option('dmx', type: 'boolean', value: false, option('dmx', type: 'boolean', value: false,
description: 'Enable DMX nested X server') description: 'Enable DMX nested X server')
option('xvfb', type: 'boolean', value: true, option('xvfb', type: 'boolean', value: true,
description: 'Enable Xvfb X server') description: 'Enable Xvfb X server')
option('xwin', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', option('xwin', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable XWin X server') description: 'Enable XWin X server')
option('builder_addr', type: 'string', description: 'Builder address', value: 'xorg@lists.freedesktop.org') option('builder_addr', type: 'string', description: 'Builder address', value: 'xorg@lists.freedesktop.org')
@ -25,7 +25,7 @@ option('module_dir', type: 'string',
option('glx', type: 'boolean', value: true) option('glx', type: 'boolean', value: true)
option('xdmcp', type: 'boolean', value: true) option('xdmcp', type: 'boolean', value: true)
option('xdm-auth-1', type: 'boolean', value: true) option('xdm-auth-1', type: 'boolean', value: true)
option('ipv6', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto') option('ipv6', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto')
option('xkb_dir', type: 'string') option('xkb_dir', type: 'string')
option('xkb_output_dir', type: 'string') option('xkb_output_dir', type: 'string')
@ -41,22 +41,22 @@ option('vendor_name_short', type: 'string', value: 'X.Org')
option('vendor_web', type: 'string', value: 'http://wiki.x.org') option('vendor_web', type: 'string', value: 'http://wiki.x.org')
option('os_vendor', type: 'string', value: '') option('os_vendor', type: 'string', value: '')
option('int10', type: 'combo', choices: ['stub', 'x86emu', 'vm86', 'auto', 'disabled'], option('int10', type: 'combo', choices: ['stub', 'x86emu', 'vm86', 'auto', 'false'],
value: 'auto', value: 'auto',
description: 'Xorg int10 backend (default: usually x86emu)') description: 'Xorg int10 backend (default: usually x86emu)')
option('pciaccess', type: 'boolean', value: 'true', option('pciaccess', type: 'boolean', value: 'true',
description: 'Xorg pciaccess support') description: 'Xorg pciaccess support')
option('udev', type: 'boolean', value: 'true') option('udev', type: 'boolean', value: 'true')
option('hal', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', option('hal', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable HAL integration') description: 'Enable HAL integration')
option('systemd_logind', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', option('systemd_logind', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable systemd-logind integration') description: 'Enable systemd-logind integration')
option('vbe', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', option('vbe', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Xorg VBE module') description: 'Xorg VBE module')
option('vgahw', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', option('vgahw', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Xorg VGA access module') description: 'Xorg VGA access module')
option('dri1', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Build DRI1 extension (default: auto)') option('dri1', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI1 extension (default: auto)')
option('dri2', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Build DRI2 extension (default: auto)') option('dri2', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI2 extension (default: auto)')
option('dri3', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Build DRI3 extension (default: auto)') option('dri3', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI3 extension (default: auto)')