aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/SConscript
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-05 16:07:07 +0000
committermarha <marha@users.sourceforge.net>2011-03-05 16:07:07 +0000
commitf027c29436a689abc94b720c2efebeddd449a61f (patch)
treee3179c623fdf42025ad9adbc401ccb111608036e /mesalib/src/glsl/SConscript
parent3592ad31cfc72ffff3c9024eecea7d3b987c7954 (diff)
parent98e55fbde340d17fdd0b1cbc408af5fecb4b7a0e (diff)
downloadvcxsrv-f027c29436a689abc94b720c2efebeddd449a61f.tar.gz
vcxsrv-f027c29436a689abc94b720c2efebeddd449a61f.tar.bz2
vcxsrv-f027c29436a689abc94b720c2efebeddd449a61f.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/glsl/SConscript')
-rw-r--r--mesalib/src/glsl/SConscript42
1 files changed, 24 insertions, 18 deletions
diff --git a/mesalib/src/glsl/SConscript b/mesalib/src/glsl/SConscript
index 4cc50484b..d7c3459f2 100644
--- a/mesalib/src/glsl/SConscript
+++ b/mesalib/src/glsl/SConscript
@@ -30,7 +30,7 @@ glcpp_parser = env.CFile('glcpp/glcpp-parse.c', 'glcpp/glcpp-parse.y')
glsl_lexer = parser_env.CXXFile('glsl_lexer.cpp', 'glsl_lexer.ll')
glsl_parser = parser_env.CXXFile('glsl_parser.cpp', 'glsl_parser.yy')
-sources = [
+glsl_sources = [
glcpp_lexer,
glcpp_parser[0],
'glcpp/pp.c',
@@ -98,19 +98,23 @@ sources = [
'strtod.c',
]
+if env['msvc']:
+ env.Prepend(CPPPATH = ['#/src/getopt'])
+ env.PrependUnique(LIBS = [getopt])
if env['crosscompile'] and env['platform'] != 'embedded':
Import('builtin_glsl_function')
else:
- if env['msvc']:
- env.Prepend(CPPPATH = ['#/src/getopt'])
- env.PrependUnique(LIBS = [getopt])
+ main_obj = env.StaticObject('main.cpp')
+
+ mesa_objs = env.StaticObject([
+ '#src/mesa/program/hash_table.c',
+ '#src/mesa/program/symbol_table.c',
+ ])
builtin_compiler = env.Program(
target = 'builtin_compiler',
- source = sources + ['main.cpp', 'builtin_stubs.cpp',
- '#src/mesa/program/hash_table.c',
- '#src/mesa/program/symbol_table.c'],
+ source = main_obj + glsl_sources + ['builtin_stubs.cpp'] + mesa_objs,
)
# SCons builtin dependency scanner doesn't detect that glsl_lexer.ll
@@ -132,11 +136,11 @@ else:
Return()
-sources += builtin_glsl_function
+glsl_sources += builtin_glsl_function
glsl = env.ConvenienceLibrary(
target = 'glsl',
- source = sources,
+ source = glsl_sources,
)
# SCons builtin dependency scanner doesn't detect that glsl_lexer.ll depends on
@@ -145,8 +149,10 @@ env.Depends(glsl, glsl_parser)
Export('glsl')
-# FIXME: We can't build the programs because there's a cyclic dependency between tis directory and src/mesa
-Return()
+# Skip building these programs as they will cause SCons error "Two environments
+# with different actions were specified for the same target"
+if env['crosscompile'] or env['platform'] == 'embedded':
+ Return()
env = env.Clone()
@@ -157,14 +163,14 @@ if env['platform'] == 'windows':
env.Prepend(LIBS = [glsl])
-env.Program(
+glsl2 = env.Program(
target = 'glsl2',
- source = [
- 'main.cpp',
- ]
+ source = main_obj + mesa_objs,
)
+env.Alias('glsl2', glsl2)
-env.Program(
- target = 'glcpp',
- source = ['glcpp/glcpp.c'],
+glcpp = env.Program(
+ target = 'glcpp/glcpp',
+ source = ['glcpp/glcpp.c'] + mesa_objs,
)
+env.Alias('glcpp', glcpp)