2009-01-23 12:32:35 +00:00
|
|
|
Import('*')
|
|
|
|
|
|
2010-01-01 19:58:39 +00:00
|
|
|
# Shared environment settings
|
2009-01-23 12:32:35 +00:00
|
|
|
env = env.Clone()
|
|
|
|
|
|
|
|
|
|
env.PrependUnique(CPPPATH = [
|
|
|
|
|
'#/include',
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
if env['platform'] == 'windows':
|
|
|
|
|
env.PrependUnique(LIBS = [
|
|
|
|
|
'glu32',
|
|
|
|
|
'opengl32',
|
|
|
|
|
'gdi32',
|
|
|
|
|
'user32',
|
|
|
|
|
])
|
|
|
|
|
else:
|
|
|
|
|
env.PrependUnique(LIBS = [
|
|
|
|
|
'GLU',
|
|
|
|
|
'GL',
|
|
|
|
|
'X11',
|
|
|
|
|
])
|
2009-12-31 21:10:25 +00:00
|
|
|
|
2010-01-01 19:58:39 +00:00
|
|
|
# Library specific environment settings
|
|
|
|
|
lib_env = env.Clone()
|
|
|
|
|
|
|
|
|
|
lib_env.Append(CPPDEFINES = [
|
|
|
|
|
'GLEW_BUILD',
|
|
|
|
|
#'GLEW_MX', # Multiple Rendering Contexts support
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
if lib_env['platform'] == 'windows':
|
2009-12-31 21:10:25 +00:00
|
|
|
target = 'glew'
|
|
|
|
|
else:
|
|
|
|
|
target = 'GLEW'
|
|
|
|
|
|
2010-01-08 00:33:58 +00:00
|
|
|
source = [
|
|
|
|
|
'glew.c',
|
|
|
|
|
]
|
2010-01-01 22:35:28 +00:00
|
|
|
|
2010-01-01 19:58:39 +00:00
|
|
|
if lib_env['platform'] == 'windows':
|
2010-01-08 00:33:58 +00:00
|
|
|
glew = lib_env.SharedLibrary(target = target, source = source)
|
|
|
|
|
env.InstallSharedLibrary(glew, version=(1, 5, 2))
|
2010-01-01 19:58:39 +00:00
|
|
|
glew = lib_env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')
|
2010-01-08 00:33:58 +00:00
|
|
|
else:
|
|
|
|
|
# Use static library on Unices to avoid binary compatability issues
|
|
|
|
|
lib_env.Append(CPPDEFINES = ['GLEW_STATIC'])
|
|
|
|
|
glew = lib_env.StaticLibrary(target = target, source = source)
|
2009-12-31 21:10:25 +00:00
|
|
|
|
2010-01-01 19:58:39 +00:00
|
|
|
# Program specific environment settings
|
|
|
|
|
prog_env = env.Clone()
|
2009-12-31 21:10:25 +00:00
|
|
|
|
2010-01-01 19:58:39 +00:00
|
|
|
prog_env.Prepend(LIBS = [glew])
|
2009-01-23 12:32:35 +00:00
|
|
|
|
2010-01-01 19:58:39 +00:00
|
|
|
prog_env.Program(
|
2009-01-23 12:32:35 +00:00
|
|
|
target = 'glewinfo',
|
|
|
|
|
source = ['glewinfo.c'],
|
|
|
|
|
)
|
|
|
|
|
|
2010-01-01 19:58:39 +00:00
|
|
|
prog_env.Program(
|
2009-01-23 12:32:35 +00:00
|
|
|
target = 'visualinfo',
|
|
|
|
|
source = ['visualinfo.c'],
|
|
|
|
|
)
|
2009-12-31 21:10:25 +00:00
|
|
|
|
|
|
|
|
Export('glew')
|