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