* Make sure that we only have a compile and link time dependency on Cairo when compiling and linking betawidget, not when using it

* When only compiling and linking against betawidget just forward declare cairo_t


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5938 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-09-06 15:38:31 +00:00
parent a8aa84dec4
commit 6150e58b45
4 changed files with 41 additions and 6 deletions

View File

@ -1,16 +1,20 @@
CPPFLAGS=$(CAIRO_SVG_CFLAGS) $(SDL_CFLAGS)
LIBS=$(CAIRO_SVG_LIBS) $(SDL_LIBS)
CPPFLAGS=$(SDL_CFLAGS)
LIBS=$(SDL_LIBS)
lib_LTLIBRARIES = libbetawidget.la
libbetawidget_la_SOURCES = font.c geom.c hBox.c spacer.c textEntry.c vector.c \
widget.c window.c
libbetawidget_la_CPPFLAGS = $(CAIRO_SVG_CFLAGS) -DLIB_COMPILE=1
libbetawidget_la_LDFLAGS = $(CAIRO_SVG_LIBS)
# FIXME: Headers required for the public API should be placed in the
# inlude_HEADERS directory.
noinst_HEADERS = clipboard.h font.h geom.h hBox.h keycode.h spacer.h \
textEntry.h vector.h widget.h window.h
noinst_HEADERS = clipboard.h font.h geom.h hBox.h internal-cairo.h keycode.h \
spacer.h textEntry.h vector.h widget.h window.h
# Platform selection
PLATFORM=platform/sdl
libbetawidget_la_SOURCES += $(PLATFORM)/event.c $(PLATFORM)/init.c \

View File

@ -21,7 +21,7 @@
#ifndef FONT_H_
#define FONT_H_
#include <cairo.h>
#include "internal-cairo.h"
/*
* Forward declarations

View File

@ -0,0 +1,31 @@
/*
This file is part of Warzone 2100.
Copyright (C) 2008 Giel van Schijndel
Copyright (C) 2008 Warzone Resurrection Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __INCLUDED_BETAWIDGET_INTERNAL_CAIRO_H__
#define __INCLUDED_BETAWIDGET_INTERNAL_CAIRO_H__
#if defined(LIB_COMPILE)
# include <cairo.h>
#else
// Forward declaration to allow pointers
typedef struct _cairo cairo_t;
#endif
#endif // __INCLUDED_BETAWIDGET_INTERNAL_CAIRO_H__

View File

@ -26,7 +26,7 @@
#include <stdlib.h>
#include <assert.h>
#include <cairo.h>
#include "internal-cairo.h"
#if __APPLE__
# include <OpenGL/gl.h>