On Friday, 2018-05-11 08:54:13 -0700, Dylan Baker wrote:
> Quoting Eric Engestrom (2018-05-11 07:12:29)
> > Fixes: 5608d0a2cee47c7d037f ("meson: use array type options")
> > Signed-off-by: Eric Engestrom <eric.engest...@intel.com>
> > ---
> >  meson.build | 26 +++++++++++---------------
> >  1 file changed, 11 insertions(+), 15 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index a8999f37bd06a84cf7c0..5dd5168eb95dc823bbbe 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -231,12 +231,6 @@ else
> >    with_dri_platform = 'none'
> >  endif
> >  
> > -with_platform_android = false
> > -with_platform_wayland = false
> > -with_platform_x11 = false
> > -with_platform_drm = false
> > -with_platform_surfaceless = false
> > -egl_native_platform = ''
> >  _platforms = get_option('platforms')
> >  if _platforms.contains('auto')
> >    if system_has_kms_drm
> > @@ -249,13 +243,15 @@ if _platforms.contains('auto')
> >      error('Unknown OS. Please pass -Dplatforms to set platforms. Patches 
> > gladly accepted to fix this.')
> >    endif
> >  endif
> > -if _platforms != ['']
> > -  with_platform_android = _platforms.contains('android')
> > -  with_platform_x11 = _platforms.contains('x11')
> > -  with_platform_wayland = _platforms.contains('wayland')
> > -  with_platform_drm = _platforms.contains('drm')
> > -  with_platform_haiku = _platforms.contains('haiku')
> > -  with_platform_surfaceless = _platforms.contains('surfaceless')
> > +
> > +with_platform_android = _platforms.contains('android')
> > +with_platform_x11 = _platforms.contains('x11')
> > +with_platform_wayland = _platforms.contains('wayland')
> > +with_platform_drm = _platforms.contains('drm')
> > +with_platform_haiku = _platforms.contains('haiku')
> > +with_platform_surfaceless = _platforms.contains('surfaceless')
> > +
> 
> > +if _platforms.length() != 0
> >    egl_native_platform = _platforms[0]
> >  endif
> 
> This isn't going to work, since if you set -Dplatforms=, then _platforms will 
> ==
> ['']

Ah, good catch :/

That said, I just realised that the core of the issue is that
meson_options.txt allows empty strings for the array options; would you
be ok with this patch, to avoid having to keep trying to make both
concepts behave the same?

---8<---
diff --git a/meson_options.txt b/meson_options.txt
index ce7d87f1ebd74a4ecc2c..b851f086a2b756142d8d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -23,7 +23,7 @@ option(
   type : 'array',
   value : ['auto'],
   choices : [
-    '', 'auto', 'x11', 'wayland', 'drm', 'surfaceless', 'haiku', 'android',
+    'auto', 'x11', 'wayland', 'drm', 'surfaceless', 'haiku', 'android',
   ],
   description : 'comma separated list of window systems to support. If this is 
set to auto all platforms applicable to the OS will be enabled.'
 )
@@ -38,7 +38,7 @@ option(
   'dri-drivers',
   type : 'array',
   value : ['auto'],
-  choices : ['', 'auto', 'i915', 'i965', 'r100', 'r200', 'nouveau', 'swrast'],
+  choices : ['auto', 'i915', 'i965', 'r100', 'r200', 'nouveau', 'swrast'],
   description : 'List of dri drivers to build. If this is set to auto all 
drivers applicable to the target OS/architecture will be built'
 )
 option(
@@ -58,7 +58,7 @@ option(
   type : 'array',
   value : ['auto'],
   choices : [
-    '', 'auto', 'pl111', 'radeonsi', 'r300', 'r600', 'nouveau', 'freedreno',
+    'auto', 'pl111', 'radeonsi', 'r300', 'r600', 'nouveau', 'freedreno',
     'swrast', 'vc4', 'vc5', 'etnaviv', 'imx', 'tegra', 'i915', 'svga', 'virgl',
     'swr',
   ],
@@ -152,7 +152,7 @@ option(
   'vulkan-drivers',
   type : 'array',
   value : ['auto'],
-  choices : ['', 'auto', 'amd', 'intel'],
+  choices : ['auto', 'amd', 'intel'],
   description : 'List of vulkan drivers to build. If this is set to auto all 
drivers applicable to the target OS/architecture will be built'
 )
 option(
--->8---

> 
> >  
> > @@ -298,13 +294,13 @@ endif
> >  
> >  _egl = get_option('egl')
> >  if _egl == 'auto'
> > -  with_egl = with_dri and with_shared_glapi and egl_native_platform != ''
> > +  with_egl = with_dri and with_shared_glapi and _platforms.length() != 0
> >  elif _egl == 'true'
> >    if not with_dri
> >      error('EGL requires dri')
> >    elif not with_shared_glapi
> >      error('EGL requires shared-glapi')
> > -  elif egl_native_platform == ''
> > +  elif _platforms.length() == 0
> >      error('No platforms specified, consider -Dplatforms=drm,x11 at least')
> >    elif not ['disabled', 'dri'].contains(with_glx)
> >      error('EGL requires dri, but a GLX is being built without dri')
> 
> Same for all of these.
> 
> Dylan
> 
> > -- 
> > Cheers,
> >   Eric
> > 


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to