diff --git a/cogl/cogl/cogl-egl-defines.h.in b/cogl/cogl/cogl-egl-defines.h similarity index 94% rename from cogl/cogl/cogl-egl-defines.h.in rename to cogl/cogl/cogl-egl-defines.h index 0318a7774..292a6d949 100644 --- a/cogl/cogl/cogl-egl-defines.h.in +++ b/cogl/cogl/cogl-egl-defines.h @@ -32,6 +32,8 @@ #ifdef HAVE_EGL -@COGL_EGL_INCLUDES@ +#include +#include +#include #endif /* HAVE_EGL */ diff --git a/cogl/cogl/cogl-gl-header.h.in b/cogl/cogl/cogl-gl-header.h similarity index 92% rename from cogl/cogl/cogl-gl-header.h.in rename to cogl/cogl/cogl-gl-header.h index f6214f230..519d4f7d0 100644 --- a/cogl/cogl/cogl-gl-header.h.in +++ b/cogl/cogl/cogl-gl-header.h @@ -36,7 +36,12 @@ #include "config.h" -@COGL_GL_HEADER_INCLUDES@ +#if defined(HAVE_GL) +#include +#elif defined(HAVE_GLES2) +#include +#include +#endif #ifndef GL_OES_EGL_image #define GLeglImageOES void * diff --git a/cogl/cogl/meson.build b/cogl/cogl/meson.build index 2c47b569c..fe44d6b18 100644 --- a/cogl/cogl/meson.build +++ b/cogl/cogl/meson.build @@ -1,44 +1,6 @@ cogl_cogl_includesubdir = cogl_includesubdir / 'cogl' cogl_cogl_includedir = cogl_includedir / 'cogl' -if have_gl - cogl_gl_header_includes = ['GL/gl.h'] -elif have_gles2 - cogl_gl_header_includes = ['GLES2/gl2.h', 'GLES2/gl2ext.h'] -else - error('Neither GLES2 or OpenGL was enabled') -endif - -cogl_gl_header_includes_string = '' -foreach gl_header : cogl_gl_header_includes - cogl_gl_header_includes_string += '#include <@0@>\n'.format(gl_header) -endforeach - -cdata = configuration_data() -cdata.set('COGL_GL_HEADER_INCLUDES', cogl_gl_header_includes_string) - -cogl_gl_header_h = configure_file( - input: 'cogl-gl-header.h.in', - output: 'cogl-gl-header.h', - configuration: cdata, - install: false, -) - -if have_egl - cogl_egl_includes_string = '#include \n#include \n#include ' -else - cogl_egl_includes_string = '' -endif - -cdata = configuration_data() -cdata.set('COGL_EGL_INCLUDES', cogl_egl_includes_string) -cogl_egl_defines_h = configure_file( - input: 'cogl-egl-defines.h.in', - output: 'cogl-egl-defines.h', - configuration: cdata, - install: false, -) - cogl_deprecated_headers = [ 'deprecated/cogl-program.h', 'deprecated/cogl-shader.h', @@ -172,6 +134,12 @@ if have_gles2 cogl_driver_sources += gles_driver_sources endif +if have_gl or have_gles2 + cogl_nonintrospected_headers += [ + 'cogl-gl-header.h' + ] +endif + cogl_sources = [ cogl_driver_sources, 'winsys/cogl-winsys-private.h', @@ -362,7 +330,7 @@ endif if have_egl cogl_nonintrospected_headers += [ 'cogl-egl.h', - cogl_egl_defines_h, + 'cogl-egl-defines.h', ] cogl_sources += [ 'cogl-egl-private.h', diff --git a/meson.build b/meson.build index 2aa46a0d6..f6d55646a 100644 --- a/meson.build +++ b/meson.build @@ -214,6 +214,10 @@ if have_gles2 endif endif +if not have_gl and not have_gles2 + error('Neither GLES2 or OpenGL was enabled') +endif + if have_wayland wayland_server_dep = dependency('wayland-server', version: wayland_server_req) wayland_client_dep = dependency('wayland-client', version: wayland_server_req)