Merge branch '7.8'
[mesa.git] / src / glew / SConscript
1 Import('*')
2
3 # Shared environment settings
4 env = env.Clone()
5
6 env.PrependUnique(CPPPATH = [
7 '#/include',
8 ])
9
10 if env['platform'] == 'windows':
11 env.PrependUnique(LIBS = [
12 'glu32',
13 'opengl32',
14 'gdi32',
15 'user32',
16 ])
17 else:
18 env.Tool('x11')
19 env.PrependUnique(LIBS = [
20 'GLU',
21 'GL',
22 'X11',
23 ])
24
25 # Library specific environment settings
26 lib_env = env.Clone()
27
28 lib_env.Append(CPPDEFINES = [
29 'GLEW_BUILD',
30 #'GLEW_MX', # Multiple Rendering Contexts support
31 ])
32
33 if lib_env['platform'] == 'windows':
34 target = 'glew'
35 else:
36 target = 'GLEW'
37
38 source = [
39 'glew.c',
40 ]
41
42 if lib_env['platform'] == 'windows':
43 glew = lib_env.SharedLibrary(target = target, source = source)
44 env.InstallSharedLibrary(glew, version=(1, 5, 2))
45 glew = lib_env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')
46 else:
47 # Use static library on Unices to avoid binary compatability issues
48 lib_env.Append(CPPDEFINES = ['GLEW_STATIC'])
49 glew = lib_env.StaticLibrary(target = target, source = source)
50
51 # Program specific environment settings
52 prog_env = env.Clone()
53
54 prog_env.Prepend(LIBS = [glew])
55
56 if prog_env['platform'] == 'darwin':
57 prog_env.Append(FRAMEWORKS = ['AGL'])
58
59 prog_env.Program(
60 target = 'glewinfo',
61 source = ['glewinfo.c'],
62 )
63
64 prog_env.Program(
65 target = 'visualinfo',
66 source = ['visualinfo.c'],
67 )
68
69 Export('glew')