[Mesa-dev] [PATCH 10/48] meson: Add a platform for windows

Eric Engestrom eric.engestrom at intel.com
Tue Jun 12 11:58:53 UTC 2018


On Monday, 2018-06-11 15:55:37 -0700, Dylan Baker wrote:
> This mirrors the haiku build which uses a platform.
> ---
>  meson.build       | 16 ++++++++++++++--
>  meson_options.txt |  1 +
>  2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 634a7a21758..9c8b9ca9ba5 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -222,14 +222,24 @@ else
>    with_dri_platform = 'none'
>  endif
>  
> +with_platform_android = false
> +with_platform_haiku = false
> +with_platform_windows = false
> +with_platform_wayland = false
> +with_platform_x11 = false
> +with_platform_drm = false
> +with_platform_surfaceless = false
> +egl_native_platform = ''

guessing that's a rebase fail :P

>  _platforms = get_option('platforms')
>  if _platforms.contains('auto')
>    if system_has_kms_drm
>      _platforms = ['x11', 'wayland', 'drm', 'surfaceless']
> -  elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
> +  elif ['darwin', 'cygwin'].contains(host_machine.system())
>      _platforms = ['x11', 'surfaceless']
>    elif ['haiku'].contains(host_machine.system())
>      _platforms = ['haiku']
> +  elif host_machine.system() == 'windows'
> +    _platforms = ['windows']

I'm not convinced by this though; if you add `-D platforms=windows` on
non-Windows, what do you get?
If you remove `windows` from `platforms` on Windows, what do you get?

It seems to me like all the places where `with_platform_windows` is used
in your series, it should be `host_machine.system() == 'windows'` instead.

This is the only patch I'm (soft) NAK'ing in your series; the rest of it
is:
Acked-by: Eric Engestrom <eric.engestrom at intel.com>

>    else
>      error('Unknown OS. Please pass -Dplatforms to set platforms. Patches gladly accepted to fix this.')
>    endif
> @@ -241,6 +251,7 @@ 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_windows = _platforms.contains('windows')
>  
>  with_platforms = false
>  if _platforms.length() != 0 and _platforms != ['']
> @@ -365,7 +376,8 @@ if with_any_vk and (with_platform_x11 and not with_dri3)
>    error('Vulkan drivers require dri3 for X11 support')
>  endif
>  if with_dri or with_gallium
> -  if with_glx == 'disabled' and not with_egl and not with_platform_haiku
> +  if (with_glx == 'disabled' and not with_egl and not with_platform_haiku and
> +      not with_platform_windows)
>      error('building dri or gallium drivers require at least one window system')
>    endif
>  endif
> diff --git a/meson_options.txt b/meson_options.txt
> index 28e92509198..ad06916fc40 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -24,6 +24,7 @@ option(
>    value : ['auto'],
>    choices : [
>      '', 'auto', 'x11', 'wayland', 'drm', 'surfaceless', 'haiku', 'android',
> +    'windows',
>    ],
>    description : 'comma separated list of window systems to support. If this is set to auto all platforms applicable to the OS will be enabled.'
>  )
> -- 
> 2.17.1
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list