1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
Import('*')
if env['platform'] not in ['windows', 'linux']:
Return()
# Shared environment settings
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',
])
# Library specific environment settings
lib_env = env.Clone()
lib_env.Append(CPPDEFINES = [
'GLEW_BUILD',
#'GLEW_STATIC',
#'GLEW_MX', # Multiple Rendering Contexts support
])
if lib_env['platform'] == 'windows':
target = 'glew'
else:
target = 'GLEW'
glew = lib_env.SharedLibrary(
target = target,
source = [
'glew.c',
],
)
if lib_env['platform'] == 'windows':
glew = lib_env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')
# Program specific environment settings
prog_env = env.Clone()
prog_env.Prepend(LIBS = [glew])
prog_env.Program(
target = 'glewinfo',
source = ['glewinfo.c'],
)
prog_env.Program(
target = 'visualinfo',
source = ['visualinfo.c'],
)
Export('glew')
|