Import('*')
-if env['platform'] not in ['windows', 'linux']:
- Return()
-
+# Shared environment settings
env = env.Clone()
-env.Append(CPPDEFINES = [
- 'GLEW_BUILD',
- #'GLEW_STATIC',
- #'GLEW_MX', # Multiple Rendering Contexts support
-])
-
env.PrependUnique(CPPPATH = [
'#/include',
])
'X11',
])
-if env['platform'] == 'windows':
+# 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':
target = 'glew'
else:
target = 'GLEW'
-glew = env.SharedLibrary(
- target = target,
- source = [
- 'glew.c',
- ],
-)
+source = [
+ 'glew.c',
+]
-if env['platform'] == 'windows':
- glew = env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')
+if lib_env['platform'] == 'windows':
+ glew = lib_env.SharedLibrary(target = target, source = source)
+ env.InstallSharedLibrary(glew, version=(1, 5, 2))
+ glew = lib_env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')
+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)
-env = env.Clone()
+# Program specific environment settings
+prog_env = env.Clone()
+
+prog_env.Prepend(LIBS = [glew])
-env.Prepend(LIBS = [glew])
+if prog_env['platform'] == 'darwin':
+ prog_env.Append(FRAMEWORKS = ['AGL'])
-env.Program(
+prog_env.Program(
target = 'glewinfo',
source = ['glewinfo.c'],
)
-env.Program(
+prog_env.Program(
target = 'visualinfo',
source = ['visualinfo.c'],
)