scons: Put glut and glew shared libraries into build/xxx/bin or lib.
[mesa.git] / src / glew / SConscript
1 Import('*')
2
3 if env['platform'] not in ['windows', 'linux']:
4 Return()
5
6 # Shared environment settings
7 env = env.Clone()
8
9 env.PrependUnique(CPPPATH = [
10 '#/include',
11 ])
12
13 if env['platform'] == 'windows':
14 env.PrependUnique(LIBS = [
15 'glu32',
16 'opengl32',
17 'gdi32',
18 'user32',
19 ])
20 else:
21 env.PrependUnique(LIBS = [
22 'GLU',
23 'GL',
24 'X11',
25 ])
26
27 # Library specific environment settings
28 lib_env = env.Clone()
29
30 lib_env.Append(CPPDEFINES = [
31 'GLEW_BUILD',
32 #'GLEW_STATIC',
33 #'GLEW_MX', # Multiple Rendering Contexts support
34 ])
35
36 if lib_env['platform'] == 'windows':
37 target = 'glew'
38 else:
39 target = 'GLEW'
40
41 glew = lib_env.SharedLibrary(
42 target = target,
43 source = [
44 'glew.c',
45 ],
46 )
47
48 env.InstallSharedLibrary(glew, version=(1, 5))
49
50 if lib_env['platform'] == 'windows':
51 glew = lib_env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')
52
53 # Program specific environment settings
54 prog_env = env.Clone()
55
56 prog_env.Prepend(LIBS = [glew])
57
58 prog_env.Program(
59 target = 'glewinfo',
60 source = ['glewinfo.c'],
61 )
62
63 prog_env.Program(
64 target = 'visualinfo',
65 source = ['visualinfo.c'],
66 )
67
68 Export('glew')