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',
'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
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
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':
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)