5 from sys import executable as python_cmd
9 env.Prepend(CPPPATH = [
15 if env['platform'] == 'windows':
16 env.Prepend(CPPPATH = ['#src/talloc'])
20 'glcpp/glcpp-parse.c',
28 'glsl_parser_extras.cpp',
30 'glsl_symbol_table.cpp',
31 'hir_field_selection.cpp',
34 'ir_constant_expression.cpp',
36 'ir_expression_flattening.cpp',
37 'ir_function_can_inline.cpp',
39 'ir_hierarchical_visitor.cpp',
41 'ir_import_prototypes.cpp',
42 'ir_print_visitor.cpp',
44 'ir_rvalue_visitor.cpp',
45 'ir_set_program_inouts.cpp',
48 'ir_variable_refcount.cpp',
55 'lower_if_to_cond_assign.cpp',
56 'lower_instructions.cpp',
58 'lower_mat_op_to_vec.cpp',
60 'lower_variable_index_to_cond_assign.cpp',
61 'lower_vec_index_to_cond_assign.cpp',
62 'lower_vec_index_to_swizzle.cpp',
65 'opt_constant_folding.cpp',
66 'opt_constant_propagation.cpp',
67 'opt_constant_variable.cpp',
68 'opt_copy_propagation.cpp',
70 'opt_dead_code_local.cpp',
71 'opt_dead_functions.cpp',
72 'opt_discard_simplification.cpp',
73 'opt_function_inlining.cpp',
74 'opt_if_simplification.cpp',
75 'opt_noop_swizzle.cpp',
76 'opt_redundant_jumps.cpp',
77 'opt_structure_splitting.cpp',
78 'opt_swizzle_swizzle.cpp',
79 'opt_tree_grafting.cpp',
85 if env['platform'] == common.host_platform:
87 env.Prepend(CPPPATH = ['#/src/getopt'])
88 env.PrependUnique(LIBS = [getopt])
90 if env['platform'] == 'windows':
91 env.Prepend(CPPPATH = ['#src/talloc'])
92 env.Prepend(LIBS = [talloc])
94 env.Prepend(LIBS = ['talloc'])
96 builtin_compiler = env.Program(
97 target = 'builtin_compiler',
98 source = sources + ['main.cpp', 'builtin_stubs.cpp',
99 '#src/mesa/program/hash_table.c',
100 '#src/mesa/program/symbol_table.c'],
103 builtin_glsl_function = env.CodeGenerate(
104 target = 'builtin_function.cpp',
105 script = 'builtins/tools/generate_builtins.py',
106 source = builtin_compiler,
107 command = python_cmd + ' $SCRIPT $SOURCE > $TARGET'
110 env.Depends(builtin_glsl_function, ['builtins/tools/generate_builtins.py', 'builtins/tools/texture_builtins.py'] + Glob('builtins/ir/*'))
113 # There is no LD_LIBRARY_PATH equivalent on Windows. We need to ensure
114 # talloc.dll is on the same dir as builtin_function.
115 talloc_dll_src = talloc.dir.File('talloc.dll')
116 talloc_dll_dst = builtin_compiler[0].dir.File('talloc.dll')
117 talloc_dll = env.Command(talloc_dll_dst, talloc_dll_src, Copy(talloc_dll_dst, talloc_dll_src))
118 env.Depends('builtin_function.cpp', talloc_dll)
120 Export('builtin_glsl_function')
122 if common.cross_compiling:
125 sources += builtin_glsl_function
127 glsl = env.ConvenienceLibrary(
134 # FIXME: We can't build the programs because there's a cyclic dependency between tis directory and src/mesa
139 if env['platform'] == 'windows':
140 env.PrependUnique(LIBS = [
144 env.Prepend(LIBS = [glsl, talloc])
155 source = ['glcpp/glcpp.c'],