| # Copyright 2016 The Fuchsia Authors |
| # |
| # Permission is hereby granted, free of charge, to any person obtaining a |
| # copy of this software and associated documentation files (the "Software"), |
| # to deal in the Software without restriction, including without limitation |
| # the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| # and/or sell copies of the Software, and to permit persons to whom the |
| # Software is furnished to do so, subject to the following conditions: |
| # |
| # The above copyright notice and this permission notice (including the next |
| # paragraph) shall be included in all copies or substantial portions of the |
| # Software. |
| # |
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
| # IN THE SOFTWARE. |
| |
| import("//garnet/lib/magma/gnbuild/magma.gni") |
| |
| config("program_public_config") { |
| include_dirs = [ |
| ".", |
| "..", |
| ] |
| } |
| |
| source_set("program") { |
| public_configs = [ ":program_public_config" ] |
| |
| include_dirs = [ |
| "$mesa_build_root/src/mesa", |
| "$mesa_build_root/src/mapi", |
| ] |
| |
| deps = [ |
| ":gen", |
| "$mesa_build_root/include:c_compat", |
| "$mesa_build_root/src/compiler/glsl", |
| "$mesa_build_root/src/compiler/nir:gen", |
| "$mesa_build_root/src/mesa/main", |
| "$mesa_build_root/src/util", |
| ] |
| |
| sources = [ |
| "arbprogparse.c", |
| "arbprogparse.h", |
| "hash_table.h", |
| "ir_to_mesa.cpp", |
| "ir_to_mesa.h", |
| "prog_cache.c", |
| "prog_cache.h", |
| "prog_execute.c", |
| "prog_execute.h", |
| "prog_hash_table.c", |
| "prog_instruction.c", |
| "prog_instruction.h", |
| "prog_noise.c", |
| "prog_noise.h", |
| "prog_opt_constant_fold.c", |
| "prog_optimize.c", |
| "prog_optimize.h", |
| "prog_parameter.c", |
| "prog_parameter.h", |
| "prog_parameter_layout.c", |
| "prog_parameter_layout.h", |
| "prog_print.c", |
| "prog_print.h", |
| "prog_statevars.c", |
| "prog_statevars.h", |
| "prog_to_nir.c", |
| "prog_to_nir.h", |
| "program.c", |
| "program.h", |
| "program_parse_extra.c", |
| "program_parser.h", |
| "programopt.c", |
| "programopt.h", |
| "string_to_uint_map.cpp", |
| "symbol_table.c", |
| "symbol_table.h", |
| ] |
| } |
| |
| action("program_parser") { |
| output_header_name = "program_parse.tab.h" |
| output_impl_name = "program_parse.tab.c" |
| |
| script = "$mesa_build_root/src/compiler/glsl/bash_script_wrapper.py" |
| |
| outputs = [ |
| "$target_gen_dir/$output_header_name", |
| "$target_gen_dir/$output_impl_name", |
| ] |
| |
| inputs = [ |
| "program_parse.y", |
| ] |
| |
| args = [ |
| "yacc", |
| "-o", |
| rebase_path(target_gen_dir) + "/$output_impl_name", |
| "-p", |
| "_mesa_program_", |
| "--defines=" + rebase_path(target_gen_dir) + "/$output_header_name", |
| rebase_path(".") + "/program_parse.y", |
| ] |
| } |
| |
| action("program_lexer") { |
| input_name = "program_lexer.l" |
| output_name = "program_lexer.c" |
| |
| script = "$mesa_build_root/src/compiler/glsl/bash_script_wrapper.py" |
| |
| outputs = [ |
| "$target_gen_dir/$output_name", |
| ] |
| |
| inputs = [ |
| input_name, |
| ] |
| |
| args = [ |
| "lex", |
| "-o", |
| rebase_path(target_gen_dir) + "/$output_name", |
| rebase_path(".") + "/$input_name", |
| ] |
| } |
| |
| config("gen_public_config") { |
| include_dirs = [ |
| target_gen_dir, |
| "$target_gen_dir/..", |
| ] |
| } |
| |
| source_set("gen") { |
| public_configs = [ ":gen_public_config" ] |
| |
| include_dirs = [ |
| ".", |
| "glcpp", |
| "$mesa_build_root/src/mesa", |
| "$mesa_build_root/src/mapi", |
| ] |
| |
| cflags_cc = [ "-fpermissive" ] |
| |
| deps = [ |
| ":program_lexer", |
| ":program_parser", |
| "$mesa_build_root/include:c_compat", |
| "$mesa_build_root/src/util", |
| ] |
| |
| sources = [ |
| "$target_gen_dir/program_lexer.c", |
| "$target_gen_dir/program_parse.tab.c", |
| "$target_gen_dir/program_parse.tab.h", |
| ] |
| } |