1# Copyright © 2018 Lima Project 2# 3# Permission is hereby granted, free of charge, to any person obtaining a 4# copy of this software and associated documentation files (the "Software"), 5# to deal in the Software without restriction, including without limitation 6# the rights to use, copy, modify, merge, publish, distribute, sublicense, 7# and/or sell copies of the Software, and to permit persons to whom the 8# Software is furnished to do so, subject to the following conditions: 9# 10# The above copyright notice and this permission notice (including the next 11# paragraph) shall be included in all copies or substantial portions of the 12# Software. 13# 14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20# IN THE SOFTWARE. 21 22files_lima = files( 23 'ir/gp/gpir.h', 24 'ir/gp/nir.c', 25 'ir/gp/node.c', 26 'ir/gp/lower.c', 27 'ir/gp/scheduler.c', 28 'ir/gp/instr.c', 29 'ir/gp/codegen.h', 30 'ir/gp/codegen.c', 31 'ir/gp/reduce_scheduler.c', 32 'ir/gp/regalloc.c', 33 'ir/gp/disasm.c', 34 'ir/gp/optimize.c', 35 36 'ir/pp/ppir.h', 37 'ir/pp/nir.c', 38 'ir/pp/node.c', 39 'ir/pp/lower.c', 40 'ir/pp/scheduler.c', 41 'ir/pp/instr.c', 42 'ir/pp/regalloc.c', 43 'ir/pp/liveness.c', 44 'ir/pp/codegen.h', 45 'ir/pp/codegen.c', 46 'ir/pp/node_to_instr.c', 47 'ir/pp/disasm.c', 48 49 'ir/lima_nir_duplicate_consts.c', 50 'ir/lima_nir_duplicate_intrinsic.c', 51 'ir/lima_nir_lower_uniform_to_scalar.c', 52 'ir/lima_nir_split_load_input.c', 53 'ir/lima_nir_split_loads.c', 54 'ir/lima_nir_lower_txp.c', 55 56 'ir/lima_ir.h', 57 58 'lima_screen.c', 59 'lima_screen.h', 60 'lima_context.c', 61 'lima_context.h', 62 'lima_resource.c', 63 'lima_resource.h', 64 'lima_state.c', 65 'lima_disk_cache.c', 66 'lima_disk_cache.h', 67 'lima_draw.c', 68 'lima_program.c', 69 'lima_query.c', 70 'lima_bo.c', 71 'lima_bo.h', 72 'lima_job.c', 73 'lima_job.h', 74 'lima_parser.c', 75 'lima_parser.h', 76 'lima_util.c', 77 'lima_util.h', 78 'lima_texture.c', 79 'lima_texture.h', 80 'lima_fence.c', 81 'lima_fence.h', 82 'lima_format.h', 83 'lima_format.c', 84 'lima_gpu.h', 85 'lima_blit.c', 86 'lima_blit.h', 87) 88 89lima_nir_algebraic_c = custom_target( 90 'lima_nir_algebraic.c', 91 input : 'ir/lima_nir_algebraic.py', 92 output : 'lima_nir_algebraic.c', 93 command : [ 94 prog_python, '@INPUT@', '-p', dir_compiler_nir, 95 ], 96 capture : true, 97 depend_files : nir_algebraic_depends, 98) 99 100liblima = static_library( 101 'lima', 102 files_lima, lima_nir_algebraic_c, 103 include_directories : [ 104 inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_drivers, 105 inc_panfrost 106 ], 107 dependencies : [dep_libdrm, idep_nir_headers, idep_mesautil], 108) 109 110driver_lima = declare_dependency( 111 compile_args : '-DGALLIUM_LIMA', 112 link_with : [liblima, liblimawinsys, libpanfrost_shared], 113 dependencies : idep_nir, 114) 115 116 117lima_compiler = executable( 118 'lima_compiler', 119 files( 120 'standalone/lima_compiler_cmdline.c', 121 'standalone/glsl.cpp' 122 ), 123 include_directories : [ 124 inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_drivers, inc_mesa, inc_mapi, 125 ], 126 dependencies : [ 127 idep_nir, 128 idep_mesautil, 129 ], 130 link_with : [ 131 liblima, 132 libgallium, 133 libglsl_standalone, 134 libpanfrost_shared, 135 ], 136 build_by_default : with_tools.contains('lima'), 137 install : with_tools.contains('lima'), 138) 139 140lima_disasm = executable( 141 'lima_disasm', 142 files( 143 'standalone/lima_disasm.c', 144 ), 145 include_directories : [ 146 inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_drivers, inc_mesa, inc_mapi, 147 ], 148 dependencies : [ 149 idep_mesautil, 150 ], 151 link_with : [ 152 liblima, 153 libpanfrost_shared, 154 ], 155 build_by_default : with_tools.contains('lima'), 156 install : with_tools.contains('lima'), 157) 158 159if with_tools.contains('drm-shim') 160 subdir('drm-shim') 161endif 162