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 21files_libintel_common = files( 22 'intel_aux_map.c', 23 'intel_aux_map.h', 24 'intel_buffer_alloc.h', 25 'intel_clflush.h', 26 'intel_decoder.h', 27 'intel_disasm.c', 28 'intel_disasm.h', 29 'intel_gem.c', 30 'intel_gem.h', 31 'intel_guardband.h', 32 'intel_l3_config.c', 33 'intel_l3_config.h', 34 'intel_urb_config.c', 35 'intel_sample_positions.c', 36 'intel_sample_positions.h', 37 'intel_uuid.c', 38 'intel_uuid.h', 39 'intel_measure.c', 40 'intel_measure.h', 41 'intel_pixel_hash.h' 42) 43 44files_batch_decoder = files( 45 'intel_batch_decoder.c', 46 'intel_decoder.c', 47) 48 49batch_decoder_dependencies = [] 50if with_platform_android 51 files_libintel_common += 'intel_batch_decoder_stub.c' 52else 53 batch_decoder_dependencies += dep_expat 54 files_libintel_common += files_batch_decoder 55endif 56 57libintel_common = static_library( 58 'intel_common', 59 [files_libintel_common, genX_xml_h, sha1_h], 60 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel], 61 c_args : [no_override_init_args], 62 gnu_symbol_visibility : 'hidden', 63 link_with : [libisl], 64 dependencies : [batch_decoder_dependencies, dep_libdrm, dep_thread, idep_genxml, idep_mesautil], 65) 66 67libintel_extra_dependencies = [] 68if with_platform_android 69 libintel_extra_dependencies += dep_android 70endif 71 72idep_libintel_common = declare_dependency( 73 link_with: [libintel_common], 74 dependencies: [libintel_extra_dependencies], 75) 76 77install_intel_gpu_tests = get_option('install-intel-gpu-tests') 78if install_intel_gpu_tests and not with_tests 79 error('`install-intel-gpu-tests` requires `build-tests`') 80endif 81 82if with_tests and not with_platform_android 83 gentest_xml = files('tests/gentest.xml') 84 _name = 'gentest_pack.h' 85 gentest_pack = custom_target( 86 _name, 87 input : [gen_pack_header_py, gentest_xml], 88 output : _name, 89 command : [prog_python, '@INPUT@'], 90 capture : true, 91 depend_files: gen_pack_header_deps 92 ) 93 94 genxml_path = join_paths(meson.source_root(), 95 '@0@'.format(gentest_xml[0])) 96 97 test( 98 'genxml_test', 99 executable( 100 'genxml_test', 101 ['tests/genxml_test.c', gentest_pack], 102 include_directories : [inc_include, inc_src, inc_intel], 103 dependencies : idep_mesautil, 104 link_with : libintel_common, 105 c_args : [ 106 '-DGENXML_PATH="@0@"'.format(genxml_path) 107 ], 108 ), 109 args : ['-quiet'], 110 suite : ['intel'], 111 ) 112 113 foreach g : [['70', 'gfx7'], ['75', 'hsw'], ['80', 'gfx8'], 114 ['90', 'gfx9'], ['110', 'gfx11'], ['120', 'gfx12'], 115 ['125', 'gfx125']] 116 executable( 117 'intel_@0@_mi_builder_test'.format(g[1]), 118 files('tests/mi_builder_test.cpp'), 119 cpp_args : [ 120 cpp_msvc_compat_args, 121 '-DGFX_VERx10=@0@'.format(g[0]) 122 ], 123 gnu_symbol_visibility : 'hidden', 124 include_directories : [inc_include, inc_src, inc_intel], 125 link_with : [libintel_dev], 126 dependencies : [dep_libdrm, idep_gtest, idep_genxml, idep_mesautil], 127 install : install_intel_gpu_tests, 128 ) 129 endforeach 130endif 131