summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-01-01 19:58:39 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-01-02 00:01:42 +0000
commit14a8c9dac7ea43ad8a45052e17f7127451344e5a (patch)
tree43c3f70928cd040777f9604600415f79a4c5bbb9 /src
parentc852e960ccb5d2727ccaaf2829e89596a6be3128 (diff)
scons: Fix glew build on MSVC.
The environment for building the DLL needs to be quite different from the environment for building the programs, in order to get the dllexport/dllimport attribute done currectly. I don't know how MinGW managed to build the programs, but MS linker refuses to link symbols with mismatching attributes.
Diffstat (limited to 'src')
-rw-r--r--src/glew/SConscript33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/glew/SConscript b/src/glew/SConscript
index b4541a7c26..330231d2c6 100644
--- a/src/glew/SConscript
+++ b/src/glew/SConscript
@@ -3,14 +3,9 @@ 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',
])
@@ -29,31 +24,41 @@ else:
'X11',
])
-if env['platform'] == 'windows':
+# 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 = env.SharedLibrary(
+glew = lib_env.SharedLibrary(
target = target,
source = [
'glew.c',
],
)
-if env['platform'] == 'windows':
- glew = env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')
+if lib_env['platform'] == 'windows':
+ glew = lib_env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')
-env = env.Clone()
+# Program specific environment settings
+prog_env = env.Clone()
-env.Prepend(LIBS = [glew])
+prog_env.Prepend(LIBS = [glew])
-env.Program(
+prog_env.Program(
target = 'glewinfo',
source = ['glewinfo.c'],
)
-env.Program(
+prog_env.Program(
target = 'visualinfo',
source = ['visualinfo.c'],
)