1# Copyright © 2017 Intel 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 21libaub = static_library( 22 'aub', 23 files('aub_read.c', 'aub_mem.c'), 24 include_directories : [inc_include, inc_src, inc_intel], 25 dependencies : idep_mesautil, 26 link_with : [libintel_common, libintel_dev], 27 c_args : [no_override_init_args], 28 gnu_symbol_visibility : 'hidden', 29 install : false 30) 31 32aubinator = executable( 33 'aubinator', 34 files('aubinator.c'), 35 dependencies : [idep_mesautil, dep_expat, dep_zlib, dep_dl, dep_thread, dep_m], 36 include_directories : [inc_include, inc_src, inc_intel], 37 link_with : [libintel_common, libintel_compiler, libintel_dev, libaub], 38 c_args : [no_override_init_args], 39 gnu_symbol_visibility : 'hidden', 40 install : true 41) 42 43aubinator_error_decode = executable( 44 'aubinator_error_decode', 45 files('aubinator_error_decode.c'), 46 dependencies : [idep_mesautil, dep_zlib, dep_thread], 47 include_directories : [inc_include, inc_src, inc_intel], 48 link_with : [libintel_common, libintel_compiler, libintel_dev], 49 c_args : [no_override_init_args], 50 gnu_symbol_visibility : 'hidden', 51 install : true 52) 53 54i965_disasm = executable( 55 'i965_disasm', 56 files('i965_disasm.c'), 57 dependencies : [idep_mesautil, dep_thread], 58 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_intel], 59 link_with : [libintel_common, libintel_compiler, libintel_dev], 60 c_args : [no_override_init_args], 61 gnu_symbol_visibility : 'hidden', 62 install : true 63) 64 65error2aub = executable( 66 'intel_error2aub', 67 files('aub_write.h', 'aub_write.c', 'error2aub.c'), 68 dependencies : [dep_zlib, dep_dl, dep_thread, dep_m], 69 include_directories : [inc_include, inc_src, inc_intel], 70 link_with : [libintel_dev], 71 c_args : [no_override_init_args], 72 gnu_symbol_visibility : 'hidden', 73 install : true 74) 75 76sanitize_data = configuration_data() 77sanitize_data.set( 78 'install_libexecdir', 79 join_paths(get_option('prefix'), get_option('libexecdir')) 80) 81sanitize_data.set( 82 'install_libdir', 83 join_paths(get_option('prefix'), get_option('libdir')) 84) 85configure_file( 86 input : 'intel_sanitize_gpu.in', 87 output : '@BASENAME@', 88 install_dir : get_option('bindir'), 89 install : true, 90 configuration : sanitize_data 91) 92 93libintel_sanitize_gpu = shared_library( 94 'intel_sanitize_gpu', 95 files('intel_sanitize_gpu.c'), 96 dependencies : [idep_mesautil, dep_dl, dep_thread], 97 include_directories : [inc_include, inc_src, inc_intel], 98 link_with : libintel_common, 99 c_args : [no_override_init_args, c_sse2_args], 100 gnu_symbol_visibility : 'hidden', 101 install_dir : get_option('libexecdir'), 102 install : true 103) 104 105configure_file( 106 input : 'intel_dump_gpu.in', 107 output : '@BASENAME@', 108 install_dir : get_option('bindir'), 109 configuration : sanitize_data, 110 install : true 111) 112 113libintel_dump_gpu = shared_library( 114 'intel_dump_gpu', 115 files( 116 'intel_context.h', 'gfx8_context.h', 'gfx10_context.h', 'intel_aub.h', 117 'aub_write.h', 'aub_write.c', 'intel_dump_gpu.c', 118 ), 119 dependencies : [dep_dl, idep_mesautil], 120 include_directories : [inc_include, inc_src, inc_intel], 121 link_with : libintel_dev, 122 c_args : [no_override_init_args], 123 gnu_symbol_visibility : 'hidden', 124 install_dir : get_option('libexecdir'), 125 install : true 126) 127 128if with_tools.contains('drm-shim') 129 configure_file( 130 input : 'intel_stub_gpu.in', 131 output : '@BASENAME@', 132 install_dir : get_option('bindir'), 133 configuration : sanitize_data, 134 install : true 135 ) 136 137 libintel_stub_gpu = shared_library( 138 'intel_noop_drm_shim', 139 'intel_noop_drm_shim.c', 140 include_directories: [inc_include, inc_src, inc_intel], 141 link_with: libintel_dev, 142 dependencies: [dep_libdrm, dep_drm_shim, idep_mesautil, idep_libintel_common], 143 gnu_symbol_visibility : 'hidden', 144 install : true, 145 ) 146endif 147 148if with_tools.contains('intel-ui') 149 subdir('imgui') 150 151 aubinator_viewer = executable( 152 'aubinator_viewer', 153 files('aubinator_viewer.cpp', 'aubinator_viewer_decoder.cpp'), 154 dependencies : [idep_mesautil, dep_zlib, dep_dl, dep_thread, dep_m, libintel_imgui_gtk_dep], 155 include_directories : [inc_include, inc_src, inc_intel], 156 link_with : [libintel_common, libintel_compiler, libintel_dev, libaub], 157 c_args : [no_override_init_args], 158 gnu_symbol_visibility : 'hidden', 159 cpp_args : ['-fpermissive', '-Wno-parentheses', '-Wno-class-memaccess'], 160 install : true 161 ) 162endif 163 164bison_command = [] 165if yacc_is_bison 166 bison_command = [ 167 prog_bison, '@INPUT@', '--defines=@OUTPUT1@', 168 '--output=@OUTPUT0@' 169 ] 170else 171 bison_command = [ 172 prog_bison, '-H', '@OUTPUT1@', 173 '-o', '@OUTPUT0@', '@INPUT@' 174 ] 175endif 176 177i965_gram_tab = custom_target( 178 'i965_gram.tab.[ch]', 179 input : 'i965_gram.y', 180 output : ['i965_gram.tab.c', 'i965_gram.tab.h'], 181 command : bison_command 182) 183 184i965_lex_yy_c = custom_target( 185 'i965_lex.yy.c', 186 input : 'i965_lex.l', 187 output : 'i965_lex.yy.c', 188 command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'] 189) 190 191i965_asm = executable( 192 'i965_asm', 193 ['i965_asm.c', i965_gram_tab[0], i965_gram_tab[1], i965_lex_yy_c], 194 dependencies : [idep_mesautil, dep_thread], 195 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_intel], 196 link_with : [libintel_common, libintel_compiler, libintel_dev], 197 c_args : [no_override_init_args], 198 gnu_symbol_visibility : 'hidden', 199 install : true 200) 201 202asm_testcases = [ 203 ['brw', 'gfx4'], 204 ['g4x', 'gfx4.5'], 205 ['ilk', 'gfx5'], 206 ['snb', 'gfx6'], 207 ['ivb', 'gfx7'], 208 ['hsw', 'gfx7.5'], 209 ['bdw', 'gfx8'], 210 ['skl', 'gfx9'], 211 ['icl', 'gfx11'], 212] 213 214test_runner = find_program('tests/run-test.py') 215foreach testcase : asm_testcases 216 _gen_name = testcase[0] 217 _gen_num = testcase[1] 218 _gen_folder = join_paths(meson.current_source_dir(), 'tests', _gen_num) 219 test( 220 'i965_asm_' + _gen_num, test_runner, 221 args : [ 222 '--i965_asm', i965_asm, 223 '--gen_name', _gen_name, 224 '--gen_folder', _gen_folder, 225 ], 226 suite : 'intel', 227 ) 228endforeach 229