blob: ce6e71e1570751ecd40f6e018af3b13d7818fa48 [file] [log] [blame]
José Fonseca57d00012009-01-23 12:32:35 +00001Import('*')
2
José Fonseca14a8c9d2010-01-01 19:58:39 +00003# Shared environment settings
José Fonseca57d00012009-01-23 12:32:35 +00004env = env.Clone()
5
José Fonseca57d00012009-01-23 12:32:35 +00006env.PrependUnique(CPPPATH = [
7 '#/include',
8])
9
José Fonseca57d00012009-01-23 12:32:35 +000010if env['platform'] == 'windows':
11 env.PrependUnique(LIBS = [
12 'glu32',
13 'opengl32',
14 'gdi32',
15 'user32',
16 ])
17else:
18 env.PrependUnique(LIBS = [
19 'GLU',
20 'GL',
21 'X11',
22 ])
José Fonseca7bbf7f92009-12-31 21:10:25 +000023
José Fonseca14a8c9d2010-01-01 19:58:39 +000024# Library specific environment settings
25lib_env = env.Clone()
26
27lib_env.Append(CPPDEFINES = [
28 'GLEW_BUILD',
José Fonseca14a8c9d2010-01-01 19:58:39 +000029 #'GLEW_MX', # Multiple Rendering Contexts support
30])
31
32if lib_env['platform'] == 'windows':
José Fonseca7bbf7f92009-12-31 21:10:25 +000033 target = 'glew'
34else:
35 target = 'GLEW'
36
José Fonsecade22c942010-01-08 00:33:58 +000037source = [
38 'glew.c',
39]
José Fonseca8a318ed2010-01-01 22:35:28 +000040
José Fonseca14a8c9d2010-01-01 19:58:39 +000041if lib_env['platform'] == 'windows':
José Fonsecade22c942010-01-08 00:33:58 +000042 glew = lib_env.SharedLibrary(target = target, source = source)
43 env.InstallSharedLibrary(glew, version=(1, 5, 2))
José Fonseca14a8c9d2010-01-01 19:58:39 +000044 glew = lib_env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')
José Fonsecade22c942010-01-08 00:33:58 +000045else:
46 # Use static library on Unices to avoid binary compatability issues
47 lib_env.Append(CPPDEFINES = ['GLEW_STATIC'])
48 glew = lib_env.StaticLibrary(target = target, source = source)
José Fonseca7bbf7f92009-12-31 21:10:25 +000049
José Fonseca14a8c9d2010-01-01 19:58:39 +000050# Program specific environment settings
51prog_env = env.Clone()
José Fonseca7bbf7f92009-12-31 21:10:25 +000052
José Fonseca14a8c9d2010-01-01 19:58:39 +000053prog_env.Prepend(LIBS = [glew])
José Fonseca57d00012009-01-23 12:32:35 +000054
José Fonseca14a8c9d2010-01-01 19:58:39 +000055prog_env.Program(
José Fonseca57d00012009-01-23 12:32:35 +000056 target = 'glewinfo',
57 source = ['glewinfo.c'],
58)
59
José Fonseca14a8c9d2010-01-01 19:58:39 +000060prog_env.Program(
José Fonseca57d00012009-01-23 12:32:35 +000061 target = 'visualinfo',
62 source = ['visualinfo.c'],
63)
José Fonseca7bbf7f92009-12-31 21:10:25 +000064
65Export('glew')