diff options
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/SConscript | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/glsl/SConscript b/src/glsl/SConscript index bb02a87c790..ef10ca9751e 100644 --- a/src/glsl/SConscript +++ b/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]) + +main_obj = env.StaticObject('main.cpp') + +mesa_objs = env.StaticObject([ + '#src/mesa/program/hash_table.c', + '#src/mesa/program/symbol_table.c', +]) if env['crosscompile'] and env['platform'] != 'embedded': Import('builtin_glsl_function') else: - if env['msvc']: - env.Prepend(CPPPATH = ['#/src/getopt']) - env.PrependUnique(LIBS = [getopt]) - 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,9 +149,6 @@ 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() - env = env.Clone() if env['platform'] == 'windows': @@ -157,14 +158,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) |