summaryrefslogtreecommitdiffstats
path: root/src/glsl/SConscript
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2011-03-01 15:04:04 -0800
committerKenneth Graunke <[email protected]>2011-03-01 15:49:29 -0800
commit8be58df67a3d3cc682407f10badcb92a1c988e65 (patch)
treeac643eba6dcb2a7a014fe052df20634a41248062 /src/glsl/SConscript
parent80ec97af79530dc053770d218cd55ac7dbd74736 (diff)
scons: Use Flex and Bison to generate lexer/parser files.
This gets it building again here; I'll leave it up to the SCons maintainers to make further improvements.
Diffstat (limited to 'src/glsl/SConscript')
-rw-r--r--src/glsl/SConscript19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/glsl/SConscript b/src/glsl/SConscript
index 7c6b6ae8c4d..10abab6f945 100644
--- a/src/glsl/SConscript
+++ b/src/glsl/SConscript
@@ -11,18 +11,29 @@ env.Prepend(CPPPATH = [
'#src/mapi',
'#src/mesa',
'#src/glsl',
+ '#src/glsl/glcpp',
])
+env.Append(YACCFLAGS = '-d')
+
+parser_env = env.Clone();
+parser_env.Append(YACCFLAGS = ['--defines=src/glsl/glsl_parser.h', '-p', '_mesa_glsl_'])
+
+glcpp_lexer = env.CFile('glcpp/glcpp-lex.c', 'glcpp/glcpp-lex.l')
+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 = [
- 'glcpp/glcpp-lex.c',
- 'glcpp/glcpp-parse.c',
+ glcpp_lexer,
+ glcpp_parser[0],
'glcpp/pp.c',
'ast_expr.cpp',
'ast_function.cpp',
'ast_to_hir.cpp',
'ast_type.cpp',
- 'glsl_lexer.cpp',
- 'glsl_parser.cpp',
+ glsl_lexer,
+ glsl_parser[0],
'glsl_parser_extras.cpp',
'glsl_types.cpp',
'glsl_symbol_table.cpp',