GLEW: Define static + enabled and includes via SCons

This allows us not to have to hack our definitions in the upstream files,
making it easier to upgrade to newer versions in the future.

For the include paths to work, the headers are moved to a GL subfolder to
match their upstream location.
This commit is contained in:
Rémi Verschelde
2016-06-07 19:59:33 +02:00
parent 4c658dc523
commit 768e925271
12 changed files with 23 additions and 29 deletions

View File

@ -80,8 +80,6 @@
#define __glew_h__
#define __GLEW_H__
#define GLEW_STATIC
#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H)
#error gl.h included before glew.h
#endif

View File

@ -80,8 +80,6 @@
#define __glxew_h__
#define __GLXEW_H__
#define GLEW_STATIC
#ifdef __glxext_h_
#error glxext.h included before glxew.h
#endif
@ -99,7 +97,7 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xmd.h>
#include "drivers/gl_context/glew.h"
#include <GL/glew.h>
#ifdef __cplusplus
extern "C" {

View File

@ -56,8 +56,6 @@
#define __wglew_h__
#define __WGLEW_H__
#define GLEW_STATIC
#ifdef __wglext_h_
#error wglext.h included before wglew.h
#endif

View File

@ -1,5 +1,11 @@
Import('env')
Export('env');
env.add_source_files(env.drivers_sources,"*.cpp")
env.add_source_files(env.drivers_sources,"*.c")
if (env.get('glew') == 'yes'):
env.add_source_files(env.drivers_sources,"glew.c")
env.Append(CPPFLAGS = ['-DGLEW_ENABLED'])
env.Append(CPPFLAGS = ['-DGLEW_STATIC'])
env.Append(CPPPATH = ['.'])
Export('env')

View File

@ -1,4 +1,3 @@
#ifdef GLEW_ENABLED
/*
** The OpenGL Extension Wrangler Library
** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
@ -30,11 +29,11 @@
** THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "drivers/gl_context/glew.h"
#include <GL/glew.h>
#if defined(_WIN32)
# include "drivers/gl_context/wglew.h"
# include <GL/wglew.h>
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
# include "drivers/gl_context/glxew.h"
# include <GL/glxew.h>
#endif
/*
@ -15156,5 +15155,3 @@ GLboolean glxewIsSupported (const char* name)
}
#endif /* _WIN32 */
#endif