1# Copyright © 2018 Rob Clark 2# Copyright © 2019 Collabora 3 4# Permission is hereby granted, free of charge, to any person obtaining a copy 5# of this software and associated documentation files (the "Software"), to deal 6# in the Software without restriction, including without limitation the rights 7# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8# copies of the Software, and to permit persons to whom the Software is 9# furnished to do so, subject to the following conditions: 10 11# The above copyright notice and this permission notice shall be included in 12# all copies or substantial portions of the 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 THE 17# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20# SOFTWARE. 21 22libasahi_agx_files = files( 23 'agx_compile.c', 24 'agx_dce.c', 25 'agx_liveness.c', 26 'agx_lower_parallel_copy.c', 27 'agx_lower_pseudo.c', 28 'agx_pack.c', 29 'agx_print.c', 30 'agx_optimizer.c', 31 'agx_register_allocate.c', 32 'agx_uniforms.c', 33 'agx_validate.c', 34) 35 36agx_opcodes_h = custom_target( 37 'agx_opcodes.h', 38 input : ['agx_opcodes.h.py'], 39 output : 'agx_opcodes.h', 40 command : [prog_python, '@INPUT@'], 41 capture : true, 42 depend_files : files('agx_opcodes.py'), 43) 44 45idep_agx_opcodes_h = declare_dependency( 46 sources : [agx_opcodes_h], 47 include_directories : include_directories('.'), 48) 49 50agx_opcodes_c = custom_target( 51 'agx_opcodes.c', 52 input : ['agx_opcodes.c.py'], 53 output : 'agx_opcodes.c', 54 command : [prog_python, '@INPUT@'], 55 capture : true, 56 depend_files : files('agx_opcodes.py'), 57) 58 59agx_builder_h = custom_target( 60 'agx_builder.h', 61 input : ['agx_builder.h.py'], 62 output : 'agx_builder.h', 63 command : [prog_python, '@INPUT@'], 64 capture : true, 65 depend_files : files('agx_opcodes.py'), 66) 67 68idep_agx_builder_h = declare_dependency( 69 sources : [agx_builder_h], 70 include_directories : include_directories('.'), 71) 72 73libasahi_compiler = static_library( 74 'asahi_compiler', 75 [libasahi_agx_files, agx_opcodes_c], 76 include_directories : [inc_include, inc_src, inc_mesa, inc_gallium, inc_gallium_aux, inc_mapi], 77 dependencies: [idep_nir, idep_agx_opcodes_h, idep_agx_builder_h, idep_agx_pack], 78 c_args : [no_override_init_args], 79 gnu_symbol_visibility : 'hidden', 80 build_by_default : false, 81) 82 83if with_tests 84 test( 85 'agx_tests', 86 executable( 87 'agx_tests', 88 files( 89 'test/test-minifloat.cpp', 90 'test/test-optimizer.cpp', 91 'test/test-lower-pseudo.cpp', 92 'test/test-lower-parallel-copy.cpp', 93 ), 94 c_args : [c_msvc_compat_args, no_override_init_args], 95 gnu_symbol_visibility : 'hidden', 96 include_directories : [inc_include, inc_src, inc_mesa], 97 dependencies: [idep_gtest, idep_nir, idep_agx_opcodes_h, idep_agx_builder_h], 98 link_with : [libasahi_compiler], 99 ), 100 suite : ['asahi'], 101 protocol : gtest_test_protocol, 102 ) 103endif 104