diff options
author | Robert Bragg <robert@linux.intel.com> | 2013-11-28 12:34:45 +0000 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2013-11-28 15:25:32 +0000 |
commit | e0b2255876c1cf11d124d5ae37cbe9a6e43777f1 (patch) | |
tree | 082864ea8a16ae3e53b5ef244b7bd54f30519471 | |
parent | c76c1d136d2cac7f3d1331a4d1dc0dd0f06e812c (diff) | |
download | cogl-e0b2255876c1cf11d124d5ae37cbe9a6e43777f1.tar.gz |
build: fix building introspection data
This fixes the build with --enable-introspection. I'm not sure why
g-ir-scanner seems to parse all public headers in isolation instead of
being able take a more limited list of top-level public headers and
automatically parse all necessary #include directives but this means we
have to special case how we define and undefine __COGL_H_INSIDE__ to
subvert the guards we have in place for detecting misuse of the headers.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
-rw-r--r-- | cogl/Makefile.am | 2 | ||||
-rw-r--r-- | cogl/cogl-gles2.h | 20 | ||||
-rw-r--r-- | cogl/cogl-wayland-client.h | 19 | ||||
-rw-r--r-- | cogl/cogl-wayland-server.h | 20 | ||||
-rw-r--r-- | cogl/cogl-xlib-renderer.h | 21 | ||||
-rw-r--r-- | cogl/cogl-xlib.h | 25 | ||||
-rw-r--r-- | cogl/cogl.h | 16 | ||||
-rw-r--r-- | cogl/winsys/cogl-texture-pixmap-x11.h | 20 |
8 files changed, 142 insertions, 1 deletions
diff --git a/cogl/Makefile.am b/cogl/Makefile.am index 6d6280f6..90b832cd 100644 --- a/cogl/Makefile.am +++ b/cogl/Makefile.am @@ -623,7 +623,7 @@ if UNIT_TESTS Cogl_2_0_gir_LIBS += $(top_builddir)/test-fixtures/libtest-fixtures.la endif Cogl_2_0_gir_FILES = $(cogl_public_h) cogl-enum-types.h -Cogl_2_0_gir_CFLAGS = $(AM_CPPFLAGS) $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) -UCOGL_ENABLE_EXPERIMENTAL_API -UCOGL_ENABLE_EXPERIMENTAL_2_0_API +Cogl_2_0_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) -UCOGL_ENABLE_EXPERIMENTAL_API -UCOGL_ENABLE_EXPERIMENTAL_2_0_API -UCOGL_COMPILATION -D__COGL_H_INSIDE__ -D__COGL_XLIB_H_INSIDE__ Cogl_2_0_gir_INCLUDES = GL-1.0 GObject-2.0 Cogl_2_0_gir_EXPORT_PACKAGES = cogl2 Cogl_2_0_gir_SCANNERFLAGS = --warn-all --c-include='cogl/cogl.h' diff --git a/cogl/cogl-gles2.h b/cogl/cogl-gles2.h index 75d37f6d..9c551ad2 100644 --- a/cogl/cogl-gles2.h +++ b/cogl/cogl-gles2.h @@ -36,9 +36,16 @@ * api definitions */ #ifndef COGL_COMPILATION + +/* Note: When building Cogl .gir we explicitly define + * __COGL_H_INSIDE__ */ +#ifndef __COGL_H_INSIDE__ #define __COGL_H_INSIDE__ +#define __COGL_MUST_UNDEF_COGL_H_INSIDE__ #endif +#endif /* COGL_COMPILATION */ + #include <cogl/cogl-defines.h> #include <cogl/cogl-context.h> #include <cogl/cogl-framebuffer.h> @@ -379,5 +386,18 @@ cogl_is_gles2_context (void *object); COGL_END_DECLS +/* The gobject introspection scanner seems to parse public headers in + * isolation which means we need to be extra careful about how we + * define and undefine __COGL_H_INSIDE__ used to detect when internal + * headers are incorrectly included by developers. In the gobject + * introspection case we have to manually define __COGL_H_INSIDE__ as + * a commandline argument for the scanner which means we must be + * careful not to undefine it in a header... + */ +#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#undef __COGL_H_INSIDE__ +#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#endif + #endif /* __COGL_GLES2_H__ */ diff --git a/cogl/cogl-wayland-client.h b/cogl/cogl-wayland-client.h index a211a1f0..095d8293 100644 --- a/cogl/cogl-wayland-client.h +++ b/cogl/cogl-wayland-client.h @@ -31,9 +31,28 @@ * definitions */ #ifndef COGL_COMPILATION + +/* Note: When building Cogl .gir we explicitly define + * __COGL_H_INSIDE__ */ +#ifndef __COGL_H_INSIDE__ #define __COGL_H_INSIDE__ +#define __COGL_MUST_UNDEF_COGL_H_INSIDE__ #endif +#endif /* COGL_COMPILATION */ #include <cogl/cogl-wayland-renderer.h> +/* The gobject introspection scanner seems to parse public headers in + * isolation which means we need to be extra careful about how we + * define and undefine __COGL_H_INSIDE__ used to detect when internal + * headers are incorrectly included by developers. In the gobject + * introspection case we have to manually define __COGL_H_INSIDE__ as + * a commandline argument for the scanner which means we must be + * careful not to undefine it in a header... + */ +#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#undef __COGL_H_INSIDE__ +#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#endif + #endif /* __COGL_WAYLAND_CLIENT_H */ diff --git a/cogl/cogl-wayland-server.h b/cogl/cogl-wayland-server.h index a28f6a35..26561c33 100644 --- a/cogl/cogl-wayland-server.h +++ b/cogl/cogl-wayland-server.h @@ -33,9 +33,16 @@ * definitions */ #ifndef COGL_COMPILATION + +/* Note: When building Cogl .gir we explicitly define + * __COGL_H_INSIDE__ */ +#ifndef __COGL_H_INSIDE__ #define __COGL_H_INSIDE__ +#define __COGL_MUST_UNDEF_COGL_H_INSIDE__ #endif +#endif /* COGL_COMPILATION */ + #include <cogl/cogl-context.h> #include <cogl/cogl-texture-2d.h> @@ -134,4 +141,17 @@ cogl_wayland_texture_set_region_from_shm_buffer (CoglTexture *texture, COGL_END_DECLS +/* The gobject introspection scanner seems to parse public headers in + * isolation which means we need to be extra careful about how we + * define and undefine __COGL_H_INSIDE__ used to detect when internal + * headers are incorrectly included by developers. In the gobject + * introspection case we have to manually define __COGL_H_INSIDE__ as + * a commandline argument for the scanner which means we must be + * careful not to undefine it in a header... + */ +#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#undef __COGL_H_INSIDE__ +#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#endif + #endif /* __COGL_WAYLAND_SERVER_H */ diff --git a/cogl/cogl-xlib-renderer.h b/cogl/cogl-xlib-renderer.h index 569beaa8..1c0634f2 100644 --- a/cogl/cogl-xlib-renderer.h +++ b/cogl/cogl-xlib-renderer.h @@ -37,8 +37,16 @@ * definitions */ #ifndef COGL_COMPILATION + +/* Note: When building Cogl .gir we explicitly define + * __COGL_H_INSIDE__ */ +#ifndef __COGL_H_INSIDE__ #define __COGL_H_INSIDE__ +#define __COGL_MUST_UNDEF_COGL_H_INSIDE__ #endif + +#endif /* COGL_COMPILATION */ + #include <cogl/cogl-renderer.h> COGL_BEGIN_DECLS @@ -158,4 +166,17 @@ cogl_xlib_renderer_get_display (CoglRenderer *renderer); COGL_END_DECLS +/* The gobject introspection scanner seems to parse public headers in + * isolation which means we need to be extra careful about how we + * define and undefine __COGL_H_INSIDE__ used to detect when internal + * headers are incorrectly included by developers. In the gobject + * introspection case we have to manually define __COGL_H_INSIDE__ as + * a commandline argument for the scanner which means we must be + * careful not to undefine it in a header... + */ +#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#undef __COGL_H_INSIDE__ +#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#endif + #endif /* __COGL_XLIB_RENDERER_H__ */ diff --git a/cogl/cogl-xlib.h b/cogl/cogl-xlib.h index 87d7fa4a..194bec6a 100644 --- a/cogl/cogl-xlib.h +++ b/cogl/cogl-xlib.h @@ -33,10 +33,22 @@ * definitions */ #ifndef COGL_COMPILATION + +/* Note: When building Cogl .gir we explicitly define + * __COGL_XLIB_H_INSIDE__ */ +#ifndef __COGL_XLIB_H_INSIDE__ #define __COGL_XLIB_H_INSIDE__ +#endif + +/* Note: When building Cogl .gir we explicitly define + * __COGL_H_INSIDE__ */ +#ifndef __COGL_H_INSIDE__ #define __COGL_H_INSIDE__ +#define __COGL_MUST_UNDEF_COGL_H_INSIDE__ #endif +#endif /* COGL_COMPILATION */ + #include <cogl/cogl-types.h> #include <cogl/cogl-clutter-xlib.h> #include <cogl/cogl-xlib-renderer.h> @@ -64,6 +76,19 @@ cogl_xlib_handle_event (XEvent *xevent); COGL_END_DECLS + +/* The gobject introspection scanner seems to parse public headers in + * isolation which means we need to be extra careful about how we + * define and undefine __COGL_H_INSIDE__ used to detect when internal + * headers are incorrectly included by developers. In the gobject + * introspection case we have to manually define __COGL_H_INSIDE__ as + * a commandline argument for the scanner which means we must be + * careful not to undefine it in a header... + */ +#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#undef __COGL_H_INSIDE__ #undef __COGL_XLIB_H_INSIDE__ +#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#endif #endif /* __COGL_XLIB_H__ */ diff --git a/cogl/cogl.h b/cogl/cogl.h index 539a1271..fdb68bfa 100644 --- a/cogl/cogl.h +++ b/cogl/cogl.h @@ -29,7 +29,12 @@ #error "<cogl/cogl.h> shouldn't be included internally" #endif +/* Note: When building Cogl .gir we explicitly define + * __COGL_H_INSIDE__ */ +#ifndef __COGL_H_INSIDE__ #define __COGL_H_INSIDE__ +#define __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#endif #include <cogl/cogl-defines.h> #include <cogl/cogl-error.h> @@ -99,6 +104,17 @@ #include <cogl/cogl-sdl.h> #endif +/* The gobject introspection scanner seems to parse public headers in + * isolation which means we need to be extra careful about how we + * define and undefine __COGL_H_INSIDE__ used to detect when internal + * headers are incorrectly included by developers. In the gobject + * introspection case we have to manually define __COGL_H_INSIDE__ as + * a commandline argument for the scanner which means we must be + * careful not to undefine it in a header... + */ +#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__ #undef __COGL_H_INSIDE__ +#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#endif #endif /* __COGL_H__ */ diff --git a/cogl/winsys/cogl-texture-pixmap-x11.h b/cogl/winsys/cogl-texture-pixmap-x11.h index 41129a6d..1a75e80c 100644 --- a/cogl/winsys/cogl-texture-pixmap-x11.h +++ b/cogl/winsys/cogl-texture-pixmap-x11.h @@ -31,9 +31,16 @@ * definitions */ #ifndef COGL_COMPILATION + +/* Note: When building Cogl .gir we explicitly define + * __COGL_H_INSIDE__ */ +#ifndef __COGL_H_INSIDE__ #define __COGL_H_INSIDE__ +#define __COGL_MUST_UNDEF_COGL_H_INSIDE__ #endif +#endif /* COGL_COMPILATION */ + #include <cogl/cogl-context.h> COGL_BEGIN_DECLS @@ -191,4 +198,17 @@ cogl_is_texture_pixmap_x11 (void *object); COGL_END_DECLS +/* The gobject introspection scanner seems to parse public headers in + * isolation which means we need to be extra careful about how we + * define and undefine __COGL_H_INSIDE__ used to detect when internal + * headers are incorrectly included by developers. In the gobject + * introspection case we have to manually define __COGL_H_INSIDE__ as + * a commandline argument for the scanner which means we must be + * careful not to undefine it in a header... + */ +#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#undef __COGL_H_INSIDE__ +#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__ +#endif + #endif /* __COGL_TEXTURE_PIXMAP_X11_H */ |