[waffle] [PATCH 4/7] cmake: Add option waffle_has_surfaceless_egl

Chad Versace chadversary at chromium.org
Sat Oct 29 17:41:20 UTC 2016


On Wed 19 Oct 2016, Emil Velikov wrote:
> On 18 October 2016 at 18:33, Chad Versace <chadversary at chromium.org> wrote:
> > This patch contains just the CMake changes for the new surfaceless_egl
> > platform. Code will come in the following patches.
> >
> > Cc: Gurchetan Singh <gurchetansingh at chromium.org>
> > Cc: Haixia Shi <hshi at chromium.org>
> > ---
> >  Options.cmake                                       |  3 +++
> >  cmake/Modules/WaffleDefineCompilerFlags.cmake       |  4 ++++
> >  cmake/Modules/WaffleDefineInternalOptions.cmake     |  3 ++-
> >  cmake/Modules/WafflePrintConfigurationSummary.cmake |  3 +++
> >  cmake/Modules/WaffleValidateOptions.cmake           | 15 ++++++++++++++-
> >  5 files changed, 26 insertions(+), 2 deletions(-)


> > diff --git a/cmake/Modules/WaffleDefineInternalOptions.cmake b/cmake/Modules/WaffleDefineInternalOptions.cmake
> > index 3ef7a25..b3a4f7b 100644
> > --- a/cmake/Modules/WaffleDefineInternalOptions.cmake
> > +++ b/cmake/Modules/WaffleDefineInternalOptions.cmake
> > @@ -1,4 +1,5 @@
> > -if(waffle_has_wayland OR waffle_has_x11_egl OR waffle_has_gbm)
> > +if(waffle_has_wayland OR waffle_has_x11_egl OR waffle_has_gbm OR
> > +   waffle_has_surfaceless_egl)
> >      set(waffle_has_egl TRUE)
> >  else(waffle_has_wayland OR waffle_has_x11_egl)

> IIRC expressions in the else statements are meaningless in cmake.
> 
> Can we drop the above one (which seems to be the only such case in
> waffle) ? Be that here or as separate commit ?

Done. I have a local commit that drops it. It's trivial, so I'll just
push it with this series.



> > @@ -149,6 +151,11 @@ if(waffle_on_linux)
> >              message(FATAL_ERROR "x11_egl dependency is missing: ${x11_egl_missing_deps}")
> >          endif()
> >      endif()
> > +    if(waffle_has_surfaceless_egl)
> > +        if(NOT egl_FOUND)
> > +            message(FATAL_ERROR "surfaceless_egl dependency is missing: egl")
> > +        endif()
> > +    endif()

> I'm wondering if we cannot rework these (or the whole file in general)
> to minimise the boilerplate.

> Sadly no wise ideas come to mind :-(

Sigh... I felt the pain of the boilerplate when writing this patch.
Likewise, I saw no easy fix.

> > @@ -175,4 +185,7 @@ elseif(waffle_on_windows)
> >      if(waffle_has_x11_egl)
> >          message(FATAL_ERROR "Option is not supported on Windows: waffle_has_x11_egl.")
> >      endif()
> > +    if(waffle_has_surfaceless_egl)
> > +        message(FATAL_ERROR "Option is not supported on Darwin: waffle_has_surfaceless_egl.")

> ... because the about should read s/Darwin/Windows/

Oops. Fixed locally.


More information about the waffle mailing list