2009-12-10 16:29:04 +00:00
|
|
|
import common
|
|
|
|
|
|
|
|
Import('*')
|
|
|
|
|
2011-01-07 22:30:14 +00:00
|
|
|
from sys import executable as python_cmd
|
|
|
|
|
2009-12-10 16:29:04 +00:00
|
|
|
env = env.Clone()
|
|
|
|
|
2010-08-13 13:55:34 +01:00
|
|
|
env.Prepend(CPPPATH = [
|
2011-01-31 21:07:12 +00:00
|
|
|
'#include',
|
2010-08-13 13:55:34 +01:00
|
|
|
'#src/mapi',
|
|
|
|
'#src/mesa',
|
2011-01-13 20:52:01 +00:00
|
|
|
'#src/glsl',
|
2010-08-13 13:55:34 +01:00
|
|
|
])
|
|
|
|
|
2009-12-10 16:29:04 +00:00
|
|
|
sources = [
|
2010-08-13 13:55:34 +01:00
|
|
|
'glcpp/glcpp-lex.c',
|
|
|
|
'glcpp/glcpp-parse.c',
|
|
|
|
'glcpp/pp.c',
|
|
|
|
'ast_expr.cpp',
|
|
|
|
'ast_function.cpp',
|
|
|
|
'ast_to_hir.cpp',
|
|
|
|
'ast_type.cpp',
|
|
|
|
'glsl_lexer.cpp',
|
|
|
|
'glsl_parser.cpp',
|
|
|
|
'glsl_parser_extras.cpp',
|
|
|
|
'glsl_types.cpp',
|
2010-08-26 18:19:57 +01:00
|
|
|
'glsl_symbol_table.cpp',
|
2010-08-13 13:55:34 +01:00
|
|
|
'hir_field_selection.cpp',
|
|
|
|
'ir_basic_block.cpp',
|
|
|
|
'ir_clone.cpp',
|
2010-11-16 04:54:12 +00:00
|
|
|
'ir_constant_expression.cpp',
|
2010-08-13 13:55:34 +01:00
|
|
|
'ir.cpp',
|
|
|
|
'ir_expression_flattening.cpp',
|
|
|
|
'ir_function_can_inline.cpp',
|
|
|
|
'ir_function.cpp',
|
|
|
|
'ir_hierarchical_visitor.cpp',
|
|
|
|
'ir_hv_accept.cpp',
|
|
|
|
'ir_import_prototypes.cpp',
|
|
|
|
'ir_print_visitor.cpp',
|
|
|
|
'ir_reader.cpp',
|
2010-08-14 12:45:14 +01:00
|
|
|
'ir_rvalue_visitor.cpp',
|
2010-08-13 13:55:34 +01:00
|
|
|
'ir_set_program_inouts.cpp',
|
|
|
|
'ir_validate.cpp',
|
|
|
|
'ir_variable.cpp',
|
|
|
|
'ir_variable_refcount.cpp',
|
|
|
|
'linker.cpp',
|
|
|
|
'link_functions.cpp',
|
2010-09-05 10:16:30 +01:00
|
|
|
'loop_analysis.cpp',
|
|
|
|
'loop_controls.cpp',
|
|
|
|
'loop_unroll.cpp',
|
2010-11-25 09:09:26 +00:00
|
|
|
'lower_discard.cpp',
|
2010-11-15 22:35:46 +00:00
|
|
|
'lower_if_to_cond_assign.cpp',
|
2010-11-19 01:54:07 +00:00
|
|
|
'lower_instructions.cpp',
|
2010-11-15 22:35:46 +00:00
|
|
|
'lower_jumps.cpp',
|
|
|
|
'lower_mat_op_to_vec.cpp',
|
2010-09-10 00:16:19 +01:00
|
|
|
'lower_noise.cpp',
|
2010-09-08 00:35:44 +01:00
|
|
|
'lower_variable_index_to_cond_assign.cpp',
|
2010-11-15 22:35:46 +00:00
|
|
|
'lower_vec_index_to_cond_assign.cpp',
|
|
|
|
'lower_vec_index_to_swizzle.cpp',
|
2010-11-20 01:22:23 +00:00
|
|
|
'lower_vector.cpp',
|
2010-11-15 22:35:46 +00:00
|
|
|
'opt_algebraic.cpp',
|
|
|
|
'opt_constant_folding.cpp',
|
|
|
|
'opt_constant_propagation.cpp',
|
|
|
|
'opt_constant_variable.cpp',
|
|
|
|
'opt_copy_propagation.cpp',
|
2011-02-04 19:47:01 +00:00
|
|
|
'opt_copy_propagation_elements.cpp',
|
2010-11-15 22:35:46 +00:00
|
|
|
'opt_dead_code.cpp',
|
|
|
|
'opt_dead_code_local.cpp',
|
|
|
|
'opt_dead_functions.cpp',
|
2010-11-25 06:02:26 +00:00
|
|
|
'opt_discard_simplification.cpp',
|
2010-11-15 22:35:46 +00:00
|
|
|
'opt_function_inlining.cpp',
|
|
|
|
'opt_if_simplification.cpp',
|
2010-11-16 01:59:39 +00:00
|
|
|
'opt_noop_swizzle.cpp',
|
|
|
|
'opt_redundant_jumps.cpp',
|
2010-11-15 22:35:46 +00:00
|
|
|
'opt_structure_splitting.cpp',
|
|
|
|
'opt_swizzle_swizzle.cpp',
|
|
|
|
'opt_tree_grafting.cpp',
|
2011-01-15 23:16:10 +00:00
|
|
|
'ralloc.c',
|
2010-08-13 13:55:34 +01:00
|
|
|
's_expression.cpp',
|
2010-12-13 15:41:08 +00:00
|
|
|
'strtod.c',
|
2011-01-13 20:52:01 +00:00
|
|
|
]
|
2009-12-10 16:29:04 +00:00
|
|
|
|
2011-01-12 15:32:17 +00:00
|
|
|
|
2011-02-11 16:44:13 +00:00
|
|
|
if not env['crosscompile'] or env['platform'] == 'embedded':
|
2011-01-13 20:52:01 +00:00
|
|
|
if env['msvc']:
|
|
|
|
env.Prepend(CPPPATH = ['#/src/getopt'])
|
|
|
|
env.PrependUnique(LIBS = [getopt])
|
2011-01-12 16:58:37 +00:00
|
|
|
|
2011-01-13 20:52:01 +00:00
|
|
|
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'],
|
|
|
|
)
|
2011-01-07 22:30:14 +00:00
|
|
|
|
2011-01-13 20:52:01 +00:00
|
|
|
builtin_glsl_function = env.CodeGenerate(
|
|
|
|
target = 'builtin_function.cpp',
|
|
|
|
script = 'builtins/tools/generate_builtins.py',
|
|
|
|
source = builtin_compiler,
|
|
|
|
command = python_cmd + ' $SCRIPT $SOURCE > $TARGET'
|
|
|
|
)
|
|
|
|
|
|
|
|
env.Depends(builtin_glsl_function, ['builtins/tools/generate_builtins.py', 'builtins/tools/texture_builtins.py'] + Glob('builtins/ir/*'))
|
|
|
|
|
|
|
|
Export('builtin_glsl_function')
|
2011-01-07 22:30:14 +00:00
|
|
|
|
2011-01-13 20:52:01 +00:00
|
|
|
sources += builtin_glsl_function
|
2011-01-12 16:58:37 +00:00
|
|
|
|
2009-12-28 15:22:17 +00:00
|
|
|
glsl = env.ConvenienceLibrary(
|
2009-12-10 16:29:04 +00:00
|
|
|
target = 'glsl',
|
2011-01-13 20:52:01 +00:00
|
|
|
source = sources,
|
2009-12-10 16:29:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
Export('glsl')
|
|
|
|
|
2010-08-13 13:55:34 +01:00
|
|
|
# FIXME: We can't build the programs because there's a cyclic dependency between tis directory and src/mesa
|
|
|
|
Return()
|
|
|
|
|
2009-12-10 16:29:04 +00:00
|
|
|
env = env.Clone()
|
|
|
|
|
|
|
|
if env['platform'] == 'windows':
|
|
|
|
env.PrependUnique(LIBS = [
|
|
|
|
'user32',
|
|
|
|
])
|
|
|
|
|
2011-01-24 18:35:48 +00:00
|
|
|
env.Prepend(LIBS = [glsl])
|
2009-12-10 16:29:04 +00:00
|
|
|
|
|
|
|
env.Program(
|
2010-08-13 13:55:34 +01:00
|
|
|
target = 'glsl2',
|
|
|
|
source = [
|
|
|
|
'main.cpp',
|
|
|
|
]
|
2009-12-10 16:29:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
env.Program(
|
2010-08-13 13:55:34 +01:00
|
|
|
target = 'glcpp',
|
|
|
|
source = ['glcpp/glcpp.c'],
|
2009-12-10 16:29:04 +00:00
|
|
|
)
|