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