2.0: Add cogl2-experimental.h + don't pollute .pc CFLAGS

Instead of adding -DCOGL_ENABLE_EXPERIMENTAL_2_0_API to the
cogl-2.0-experimental.pc file we now install a cogl2-experimental.h
that #defines COGL_ENABLE_EXPERIMENTAL_2_0_API before including
cogl.h.

The problem with having the define in the .pc file is that you might
develop a library that depends on the experimental 2.0 api internally
and then you might want to use that library with Clutter which still
uses the 1.0 API but the .pc file for your library will indirectly,
automatically enable the 2.0 api which can cause conflicts.
This commit is contained in:
Robert Bragg 2011-09-05 22:44:37 +01:00
parent d43505db22
commit f1c2d7e965
3 changed files with 33 additions and 1 deletions

View File

@ -100,6 +100,7 @@ cogl_experimental_h = \
$(srcdir)/cogl-context.h \
$(srcdir)/cogl2-path.h \
$(srcdir)/cogl2-clip-state.h \
$(srcdir)/cogl2-experimental.h \
$(NULL)
# driver sources

View File

@ -9,5 +9,5 @@ Name: Cogl
Description: An object oriented GL/GLES Abstraction/Utility Layer
Version: @COGL_VERSION@
Libs: -L${libdir} -lcogl
Cflags: -I${includedir}/cogl -DCOGL_ENABLE_EXPERIMENTAL_2_0_API
Cflags: -I${includedir}/cogl
Requires: ${requires}

31
cogl/cogl2-experimental.h Normal file
View File

@ -0,0 +1,31 @@
/*
* Cogl
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
* Copyright (C) 2011 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
#ifndef __COGL2_EXPERIMENTAL_H__
#define __COGL2_EXPERIMENTAL_H__
#define COGL_ENABLE_EXPERIMENTAL_2_0_API
#include <cogl/cogl.h>
#endif /* __COGL2_EXPERIMENTAL_H__ */