meson: replace libmesa_util with idep_mesautil
[mesa.git] / src / intel / tools / meson.build
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 libaub = static_library(
22 'aub',
23 files('aub_read.c', 'aub_mem.c'),
24 include_directories : [inc_common, inc_intel],
25 dependencies : idep_mesautil,
26 link_with : [libintel_common, libintel_dev],
27 c_args : [c_vis_args, no_override_init_args],
28 install : false
29 )
30
31 aubinator = executable(
32 'aubinator',
33 files('aubinator.c'),
34 dependencies : [idep_mesautil, dep_expat, dep_zlib, dep_dl, dep_thread, dep_m],
35 include_directories : [inc_common, inc_intel],
36 link_with : [libintel_common, libintel_compiler, libintel_dev, libaub],
37 c_args : [c_vis_args, no_override_init_args],
38 install : true
39 )
40
41 aubinator_error_decode = executable(
42 'aubinator_error_decode',
43 files('aubinator_error_decode.c'),
44 dependencies : [idep_mesautil, dep_zlib, dep_thread],
45 include_directories : [inc_common, inc_intel],
46 link_with : [libintel_common, libintel_compiler, libintel_dev],
47 c_args : [c_vis_args, no_override_init_args],
48 install : true
49 )
50
51 i965_disasm = executable(
52 'i965_disasm',
53 files('i965_disasm.c'),
54 dependencies : [idep_mesautil, dep_thread],
55 include_directories : [inc_common, inc_intel],
56 link_with : [libintel_common, libintel_compiler, libintel_dev],
57 c_args : [c_vis_args, no_override_init_args],
58 install : true
59 )
60
61 error2aub = executable(
62 'intel_error2aub',
63 files('aub_write.h', 'aub_write.c', 'error2aub.c'),
64 dependencies : [dep_zlib, dep_dl, dep_thread, dep_m],
65 include_directories : [inc_common, inc_intel, inc_include],
66 link_with : [libintel_dev],
67 c_args : [c_vis_args, no_override_init_args],
68 install : true
69 )
70
71 sanitize_data = configuration_data()
72 sanitize_data.set(
73 'install_libexecdir',
74 join_paths(get_option('prefix'), get_option('libexecdir'))
75 )
76 configure_file(
77 input : 'intel_sanitize_gpu.in',
78 output : '@BASENAME@',
79 install_dir : get_option('bindir'),
80 install : true,
81 configuration : sanitize_data
82 )
83
84 libintel_sanitize_gpu = shared_library(
85 'intel_sanitize_gpu',
86 files('intel_sanitize_gpu.c'),
87 dependencies : [idep_mesautil, dep_dl, dep_thread],
88 include_directories : [inc_common, inc_intel, inc_include],
89 link_with : libintel_common,
90 c_args : [c_vis_args, no_override_init_args, c_sse2_args],
91 install_dir : get_option('libexecdir'),
92 install : true
93 )
94
95 configure_file(
96 input : 'intel_dump_gpu.in',
97 output : '@BASENAME@',
98 install_dir : get_option('bindir'),
99 configuration : sanitize_data,
100 install : true
101 )
102
103 libintel_dump_gpu = shared_library(
104 'intel_dump_gpu',
105 files(
106 'gen_context.h', 'gen8_context.h', 'gen10_context.h', 'intel_aub.h',
107 'aub_write.h', 'aub_write.c', 'intel_dump_gpu.c',
108 ),
109 dependencies : dep_dl,
110 include_directories : [inc_common, inc_intel, inc_include],
111 link_with : libintel_dev,
112 c_args : [c_vis_args, no_override_init_args],
113 install_dir : get_option('libexecdir'),
114 install : true
115 )
116
117 if with_tools.contains('intel-ui')
118 subdir('imgui')
119
120 aubinator_viewer = executable(
121 'aubinator_viewer',
122 files('aubinator_viewer.cpp', 'aubinator_viewer_decoder.cpp'),
123 dependencies : [idep_mesautil, dep_zlib, dep_dl, dep_thread, dep_m, libintel_imgui_gtk_dep],
124 include_directories : [inc_common, inc_intel],
125 link_with : [libintel_common, libintel_compiler, libintel_dev, libaub],
126 c_args : [c_vis_args, no_override_init_args],
127 cpp_args : ['-fpermissive', '-Wno-parentheses', '-Wno-class-memaccess'],
128 install : true
129 )
130 endif
131
132 i965_gram_tab = custom_target(
133 'i965_gram.tab.[ch]',
134 input : 'i965_gram.y',
135 output : ['i965_gram.tab.c', 'i965_gram.tab.h'],
136 command : [
137 prog_bison, '@INPUT@', '--defines=@OUTPUT1@',
138 '--output=@OUTPUT0@'
139 ]
140 )
141
142 i965_lex_yy_c = custom_target(
143 'i965_lex.yy.c',
144 input : 'i965_lex.l',
145 output : 'i965_lex.yy.c',
146 command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@']
147 )
148
149 i965_asm = executable(
150 'i965_asm',
151 ['i965_asm.c', i965_gram_tab[0], i965_gram_tab[1], i965_lex_yy_c],
152 dependencies : [idep_mesautil, dep_thread],
153 include_directories : [inc_common, inc_intel],
154 link_with : [libintel_common, libintel_compiler, libintel_dev],
155 c_args : [c_vis_args, no_override_init_args],
156 install : true
157 )
158
159 asm_testcases = [
160 ['brw', 'tests/gen4'],
161 ['g4x', 'tests/gen4.5'],
162 ['ilk', 'tests/gen5'],
163 ['snb', 'tests/gen6'],
164 ['ivb', 'tests/gen7'],
165 ['hsw', 'tests/gen7.5'],
166 ['bdw', 'tests/gen8'],
167 ['skl', 'tests/gen9'],
168 ['icl', 'tests/gen11'],
169 ]
170
171 test_runner = find_program('tests/run-test.sh')
172 foreach testcase : asm_testcases
173 test('i965_asm : ' + testcase[1], test_runner,
174 args : [i965_asm, testcase[1], testcase[0]],
175 env : ['srcdir=' + meson.current_source_dir()])
176 endforeach