1# Copyright © 2018 Valve Corporation 2 3# Permission is hereby granted, free of charge, to any person obtaining a copy 4# of this software and associated documentation files (the "Software"), to deal 5# in the Software without restriction, including without limitation the rights 6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7# copies of the Software, and to permit persons to whom the Software is 8# furnished to do so, subject to the following conditions: 9 10# The above copyright notice and this permission notice shall be included in 11# all copies or substantial portions of the Software. 12 13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19# SOFTWARE. 20 21aco_depends = files('aco_opcodes.py') 22 23aco_opcodes_h = custom_target( 24 'aco_opcodes.h', 25 input : 'aco_opcodes_h.py', 26 output : 'aco_opcodes.h', 27 command : [prog_python, '@INPUT@'], 28 capture : true, 29 depend_files : aco_depends, 30) 31 32aco_opcodes_c = custom_target( 33 'aco_opcodes.cpp', 34 input : 'aco_opcodes_cpp.py', 35 output : 'aco_opcodes.cpp', 36 command : [prog_python, '@INPUT@'], 37 capture : true, 38 depend_files : aco_depends, 39) 40 41aco_builder_h = custom_target( 42 'aco_builder.h', 43 input : 'aco_builder_h.py', 44 output : 'aco_builder.h', 45 command : [prog_python, '@INPUT@'], 46 capture : true, 47 depend_files : aco_depends, 48) 49 50# Headers-only dependency 51idep_aco_headers = declare_dependency( 52 sources : [aco_opcodes_h], 53 include_directories : include_directories('.'), 54) 55 56libaco_files = files( 57 'aco_dead_code_analysis.cpp', 58 'aco_dominance.cpp', 59 'aco_instruction_selection.cpp', 60 'aco_instruction_selection.h', 61 'aco_instruction_selection_setup.cpp', 62 'aco_interface.cpp', 63 'aco_interface.h', 64 'aco_ir.cpp', 65 'aco_ir.h', 66 'aco_assembler.cpp', 67 'aco_form_hard_clauses.cpp', 68 'aco_insert_exec_mask.cpp', 69 'aco_insert_NOPs.cpp', 70 'aco_insert_waitcnt.cpp', 71 'aco_reduce_assign.cpp', 72 'aco_register_allocation.cpp', 73 'aco_live_var_analysis.cpp', 74 'aco_lower_phis.cpp', 75 'aco_lower_to_cssa.cpp', 76 'aco_lower_to_hw_instr.cpp', 77 'aco_optimizer.cpp', 78 'aco_opt_value_numbering.cpp', 79 'aco_print_asm.cpp', 80 'aco_print_ir.cpp', 81 'aco_scheduler.cpp', 82 'aco_spill.cpp', 83 'aco_ssa_elimination.cpp', 84 'aco_statistics.cpp', 85 'aco_util.h', 86 'aco_validate.cpp', 87) 88 89cpp_args_aco = cpp.get_supported_arguments(['-fno-exceptions', '-fno-rtti']) 90 91_libaco = static_library( 92 'aco', 93 [libaco_files, aco_opcodes_c, aco_opcodes_h, aco_builder_h], 94 include_directories : [ 95 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_compiler, inc_amd, inc_amd_common, inc_amd_common_llvm, 96 ], 97 link_with : [ 98 libamd_common 99 ], 100 dependencies : [ 101 dep_llvm, dep_thread, dep_elf, dep_libdrm_amdgpu, dep_valgrind, 102 idep_nir_headers, idep_amdgfxregs_h, 103 ], 104 gnu_symbol_visibility : 'hidden', 105 build_by_default : true, 106 cpp_args : cpp_args_aco, 107) 108 109# Also link with aco 110idep_aco = declare_dependency( 111 dependencies : idep_aco_headers, 112 link_with : _libaco, 113) 114