util: add fp64 -> fp32 conversion support for RTNE and RTZ rounding modes
[mesa.git] / src / util / 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 inc_util = include_directories('.')
22
23 subdir('xmlpool')
24
25 files_mesa_util = files(
26 'anon_file.h',
27 'anon_file.c',
28 'bigmath.h',
29 'bitscan.c',
30 'bitscan.h',
31 'bitset.h',
32 'build_id.c',
33 'build_id.h',
34 'crc32.c',
35 'crc32.h',
36 'dag.c',
37 'debug.c',
38 'debug.h',
39 'disk_cache.c',
40 'disk_cache.h',
41 'double.c',
42 'double.h',
43 'fast_idiv_by_const.c',
44 'fast_idiv_by_const.h',
45 'format_r11g11b10f.h',
46 'format_rgb9e5.h',
47 'format_srgb.h',
48 'futex.h',
49 'half_float.c',
50 'half_float.h',
51 'hash_table.c',
52 'hash_table.h',
53 'list.h',
54 'macros.h',
55 'mesa-sha1.c',
56 'mesa-sha1.h',
57 'os_time.c',
58 'os_time.h',
59 'os_file.c',
60 'os_misc.c',
61 'os_misc.h',
62 'u_process.c',
63 'u_process.h',
64 'sha1/sha1.c',
65 'sha1/sha1.h',
66 'ralloc.c',
67 'ralloc.h',
68 'rand_xor.c',
69 'rand_xor.h',
70 'rb_tree.c',
71 'rb_tree.h',
72 'register_allocate.c',
73 'register_allocate.h',
74 'rgtc.c',
75 'rgtc.h',
76 'rounding.h',
77 'set.c',
78 'set.h',
79 'simple_list.h',
80 'simple_mtx.h',
81 'slab.c',
82 'slab.h',
83 'softfloat.c',
84 'softfloat.h',
85 'string_buffer.c',
86 'string_buffer.h',
87 'strndup.h',
88 'strtod.c',
89 'strtod.h',
90 'texcompress_rgtc_tmp.h',
91 'timespec.h',
92 'u_atomic.c',
93 'u_atomic.h',
94 'u_dynarray.h',
95 'u_endian.h',
96 'u_queue.c',
97 'u_queue.h',
98 'u_string.h',
99 'u_thread.h',
100 'u_vector.c',
101 'u_vector.h',
102 'u_math.c',
103 'u_math.h',
104 'u_debug.c',
105 'u_debug.h',
106 'u_cpu_detect.c',
107 'u_cpu_detect.h',
108 'vma.c',
109 'vma.h',
110 )
111
112 files_drirc = files('00-mesa-defaults.conf')
113
114 install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
115
116 if with_tests
117 prog_xmllint = find_program('xmllint', required : false, native : true)
118 if prog_xmllint.found()
119 test(
120 'drirc xml validation',
121 prog_xmllint,
122 args : ['--noout', '--valid', files_drirc],
123 suite : ['util'],
124 )
125 endif
126 endif
127
128 files_xmlconfig = files(
129 'xmlconfig.c',
130 'xmlconfig.h',
131 )
132
133 format_srgb = custom_target(
134 'format_srgb',
135 input : ['format_srgb.py'],
136 output : 'format_srgb.c',
137 command : [prog_python, '@INPUT0@'],
138 capture : true,
139 )
140
141 deps_for_libmesa_util = [
142 dep_zlib,
143 dep_clock,
144 dep_thread,
145 dep_atomic,
146 dep_m,
147 ]
148
149 if with_platform_android
150 deps_for_libmesa_util += dep_android
151 endif
152
153 _libmesa_util = static_library(
154 'mesa_util',
155 [files_mesa_util, format_srgb],
156 include_directories : inc_common,
157 dependencies : deps_for_libmesa_util,
158 c_args : [c_msvc_compat_args, c_vis_args],
159 build_by_default : false
160 )
161
162 idep_mesautil = declare_dependency(
163 link_with : _libmesa_util,
164 include_directories : inc_util,
165 dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic, dep_m],
166 )
167
168 _libxmlconfig = static_library(
169 'xmlconfig',
170 files_xmlconfig,
171 include_directories : inc_common,
172 dependencies : [idep_mesautil, dep_expat, dep_m],
173 c_args : [
174 c_msvc_compat_args, c_vis_args,
175 '-DSYSCONFDIR="@0@"'.format(
176 join_paths(get_option('prefix'), get_option('sysconfdir'))
177 ),
178 '-DDATADIR="@0@"'.format(
179 join_paths(get_option('prefix'), get_option('datadir'))
180 ),
181 ],
182 build_by_default : false,
183 )
184
185 idep_xmlconfig = declare_dependency(
186 sources : xmlpool_options_h,
187 include_directories : inc_util,
188 link_with : _libxmlconfig,
189 dependencies : dep_expat,
190 )
191
192 if with_tests
193 test(
194 'u_atomic',
195 executable(
196 'u_atomic_test',
197 files('u_atomic_test.c'),
198 include_directories : inc_common,
199 dependencies : idep_mesautil,
200 c_args : [c_msvc_compat_args],
201 ),
202 suite : ['util'],
203 )
204
205 test(
206 'roundeven',
207 executable(
208 'roundeven_test',
209 files('roundeven_test.c'),
210 include_directories : inc_common,
211 c_args : [c_msvc_compat_args],
212 dependencies : [dep_m],
213 ),
214 suite : ['util'],
215 )
216
217 test(
218 'mesa-sha1',
219 executable(
220 'mesa-sha1_test',
221 files('mesa-sha1_test.c'),
222 include_directories : inc_common,
223 dependencies : idep_mesautil,
224 c_args : [c_msvc_compat_args],
225 ),
226 suite : ['util'],
227 )
228
229 test(
230 'bitset',
231 executable(
232 'bitset_test',
233 files('bitset_test.cpp'),
234 include_directories : inc_common,
235 dependencies : [idep_mesautil, idep_gtest],
236 ),
237 suite : ['util'],
238 )
239
240 subdir('tests/fast_idiv_by_const')
241 subdir('tests/fast_urem_by_const')
242 subdir('tests/hash_table')
243 subdir('tests/string_buffer')
244 subdir('tests/timespec')
245 subdir('tests/vma')
246 subdir('tests/set')
247 endif