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 21# TODO: android? 22 23files_libintel_common = files( 24 'gen_aux_map.c', 25 'gen_aux_map.h', 26 'gen_buffer_alloc.h', 27 'gen_clflush.h', 28 'gen_batch_decoder.c', 29 'gen_decoder.c', 30 'gen_decoder.h', 31 'gen_disasm.c', 32 'gen_disasm.h', 33 'gen_gem.c', 34 'gen_gem.h', 35 'gen_guardband.h', 36 'gen_l3_config.c', 37 'gen_l3_config.h', 38 'gen_urb_config.c', 39 'gen_sample_positions.h', 40 'gen_uuid.c', 41 'gen_uuid.h', 42) 43 44libintel_common = static_library( 45 ['intel_common', genX_xml_h], 46 files_libintel_common, 47 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel], 48 c_args : [no_override_init_args], 49 gnu_symbol_visibility : 'hidden', 50 link_with : [libisl], 51 dependencies : [dep_expat, dep_libdrm, dep_thread, idep_genxml], 52) 53 54libintel_extra_dependencies = [] 55if with_platform_android 56 libintel_extra_dependencies += dep_android 57endif 58 59idep_libintel_common = declare_dependency( 60 link_with: [libintel_common], 61 dependencies: [libintel_extra_dependencies], 62) 63 64install_intel_gpu_tests = get_option('install-intel-gpu-tests') 65 66if install_intel_gpu_tests 67 foreach g : [['70', 'gen7'], ['75', 'hsw'], ['80', 'gen8'], 68 ['90', 'gen9'], ['110', 'gen11'], ['120', 'gen12']] 69 executable( 70 'intel_@0@_mi_builder_test'.format(g[1]), 71 files('tests/gen_mi_builder_test.cpp'), 72 cpp_args : [ 73 cpp_msvc_compat_args, 74 '-DGEN_VERSIONx10=@0@'.format(g[0]) 75 ], 76 gnu_symbol_visibility : 'hidden', 77 include_directories : [inc_include, inc_src, inc_intel], 78 link_with : [libintel_dev], 79 dependencies : [dep_libdrm, idep_gtest, idep_genxml, idep_mesautil], 80 install : install_intel_gpu_tests, 81 ) 82 endforeach 83endif 84 85if with_tests 86 gentest_xml = files('tests/gentest.xml') 87 _name = 'gentest_pack.h' 88 gentest_pack = custom_target( 89 _name, 90 input : [gen_pack_header_py, gentest_xml], 91 output : _name, 92 command : [prog_python, '@INPUT@'], 93 capture : true, 94 ) 95 96 genxml_path = join_paths(meson.source_root(), 97 '@0@'.format(gentest_xml[0])) 98 99 test( 100 'genxml_test', 101 executable( 102 'genxml_test', 103 ['tests/genxml_test.c', gentest_pack], 104 include_directories : [inc_include, inc_src, inc_intel], 105 dependencies : idep_mesautil, 106 link_with : libintel_common, 107 c_args : [ 108 '-DGENXML_PATH="@0@"'.format(genxml_path) 109 ], 110 ), 111 args : ['-quiet'], 112 suite : ['intel'], 113 ) 114endif 115