Don't include cogl/cogl.h from test-utils.h
There was a circular depedency when building from a fresh git clone where test-fixtures needs to be built before the cogl directory, but test-fixtures also indirectly includes cogl-enum-types.h which is only generated when building the cogl directory. If we change the header to just include specific cogl headers instead of cogl/cogl.h then we can break the circular dependency. This needs a tweak to test-no-gl-header because that first undefines COGL_COMPILATION before including test-utils.h. However it doesn't really do any actual work so we can get away without including it. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit adb26bd13a48ed571ef4cae4de005e039b34e361)
This commit is contained in:
parent
9730b9d6a6
commit
b1542cf9dd
@ -1,6 +1,5 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <cogl/cogl.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "test-unit.h"
|
#include "test-unit.h"
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#ifndef _TEST_UTILS_H_
|
#ifndef _TEST_UTILS_H_
|
||||||
#define _TEST_UTILS_H_
|
#define _TEST_UTILS_H_
|
||||||
|
|
||||||
#include <cogl/cogl.h>
|
#include <cogl/cogl-context.h>
|
||||||
|
#include <cogl/cogl-onscreen.h>
|
||||||
|
#include <cogl/cogl-offscreen.h>
|
||||||
|
#include <cogl/cogl-texture-2d.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
/* We don't really care about functions that are defined without a
|
/* We don't really care about functions that are defined without a
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
#undef COGL_COMPILATION
|
#undef COGL_COMPILATION
|
||||||
#include <cogl/cogl.h>
|
#include <cogl/cogl.h>
|
||||||
|
|
||||||
#include "test-utils.h"
|
|
||||||
|
|
||||||
/* If you just include cogl/cogl.h, you shouldn't end up including any
|
/* If you just include cogl/cogl.h, you shouldn't end up including any
|
||||||
GL headers */
|
GL headers */
|
||||||
#ifdef GL_TRUE
|
#ifdef GL_TRUE
|
||||||
#error "Including cogl.h shouldn't be including any GL headers"
|
#error "Including cogl.h shouldn't be including any GL headers"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void test_no_gl_header (void);
|
||||||
|
|
||||||
void
|
void
|
||||||
test_no_gl_header (void)
|
test_no_gl_header (void)
|
||||||
{
|
{
|
||||||
if (cogl_test_verbose ())
|
|
||||||
g_print ("OK\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <gmodule.h>
|
#include <gmodule.h>
|
||||||
|
|
||||||
#include <test-fixtures/test-unit.h>
|
#include <test-fixtures/test-unit.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user