[Buildroot] [PATCH v2] package/cegui: select libglu when libgl is detected

Bartosz Bilas b.bilas at grinn-global.com
Mon Jun 22 19:37:15 UTC 2020


Hi Thomas,

On 22.06.2020 21:10, Thomas Petazzoni wrote:
> On Sun, 21 Jun 2020 15:18:32 +0200
> Bartosz Bilas <b.bilas at grinn-global.com> wrote:
>
>> diff --git a/package/cegui/Config.in b/package/cegui/Config.in
>> index f917be0cc5..0c7932098c 100644
>> --- a/package/cegui/Config.in
>> +++ b/package/cegui/Config.in
>> @@ -9,6 +9,7 @@ config BR2_PACKAGE_CEGUI
>>   	depends on BR2_TOOLCHAIN_HAS_THREADS
>>   	depends on BR2_USE_WCHAR
>>   	select BR2_PACKAGE_GLM
>> +	select BR2_PACKAGE_LIBGLU if BR2_PACKAGE_HAS_LIBGL
> This doesn't seem correct. According to the CMakeLists.txt, cegui can
> use either libepoxy *or* glew as an "OpenGL loader" (whatever that
> means). So with your patch, we would select libglu even if it is not
> needed because we have libepoxy available.

No, we wouldn't because libglu is selected only when we have 
BR2_PACKAGE_HAS_LIBGL option set. Libepoxy doesn't provide it so even if 
we use glew instead of libepoxy we have to select libglu because cegui 
directly includes GL/glu.h here -> 
https://github.com/cegui/cegui/blob/v0-8-7/cegui/include/CEGUI/RendererModules/OpenGL/GL.h#L45

>
> See the CMakeLists.txt:
>
> if (GLEW_FOUND OR EPOXY_FOUND)
>      set (OPENGL_LOADER_FOUND TRUE)
> else ()
>      set (OPENGL_LOADER_FOUND FALSE)
> endif ()
>
> This is confirmed by ./cegui/include/CEGUI/RendererModules/OpenGL/GL.h,
> which contains:
>
> #if defined CEGUI_USE_EPOXY
>
> #include <epoxy/gl.h>
>
> #elif defined CEGUI_USE_GLEW
>
> #include <GL/glew.h>
>
> // When using GLEW, there's no need to "#include" the OpenGL headers.
> #ifndef __APPLE__
> [...]
> #else
> #   include <OpenGL/glu.h>
> #endif
>
> #else
> #error Either "CEGUI_USE_EPOXY" or "CEGUI_USE_GLEW" must be defined. Defining both or none is invalid.
> #endif
>
> So, shouldn't we make things explicit:
>
> ifeq ($(BR2_PACKAGE_GLEW)$(BR2_PACKAGE_GLU),yy)
> CEGUI_CONF_OPTS += -DCEGUI_USE_GLEW=ON
> else ifeq ($(BR2_PACKAGE_LIBEPOXY),y)
> CEGUI_CONF_OPTS += -DCEGUI_USE_EPOXY=ON
> endif
>
> or something like that ?
>
> Thomas
Best
Bartek


More information about the buildroot mailing list