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