util: Add a DAG datastructure.
[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 'bigmath.h',
27 'bitscan.c',
28 'bitscan.h',
29 'bitset.h',
30 'build_id.c',
31 'build_id.h',
32 'crc32.c',
33 'crc32.h',
34 'dag.c',
35 'debug.c',
36 'debug.h',
37 'disk_cache.c',
38 'disk_cache.h',
39 'fast_idiv_by_const.c',
40 'fast_idiv_by_const.h',
41 'format_r11g11b10f.h',
42 'format_rgb9e5.h',
43 'format_srgb.h',
44 'futex.h',
45 'half_float.c',
46 'half_float.h',
47 'hash_table.c',
48 'hash_table.h',
49 'list.h',
50 'macros.h',
51 'mesa-sha1.c',
52 'mesa-sha1.h',
53 'os_time.c',
54 'os_time.h',
55 'os_misc.c',
56 'os_misc.h',
57 'u_process.c',
58 'u_process.h',
59 'sha1/sha1.c',
60 'sha1/sha1.h',
61 'ralloc.c',
62 'ralloc.h',
63 'rand_xor.c',
64 'rand_xor.h',
65 'rb_tree.c',
66 'rb_tree.h',
67 'register_allocate.c',
68 'register_allocate.h',
69 'rgtc.c',
70 'rgtc.h',
71 'rounding.h',
72 'set.c',
73 'set.h',
74 'simple_list.h',
75 'simple_mtx.h',
76 'slab.c',
77 'slab.h',
78 'string_buffer.c',
79 'string_buffer.h',
80 'strndup.h',
81 'strtod.c',
82 'strtod.h',
83 'texcompress_rgtc_tmp.h',
84 'u_atomic.c',
85 'u_atomic.h',
86 'u_dynarray.h',
87 'u_endian.h',
88 'u_queue.c',
89 'u_queue.h',
90 'u_string.h',
91 'u_thread.h',
92 'u_vector.c',
93 'u_vector.h',
94 'u_math.c',
95 'u_math.h',
96 'u_debug.c',
97 'u_debug.h',
98 'u_cpu_detect.c',
99 'u_cpu_detect.h',
100 'vma.c',
101 'vma.h',
102 )
103
104 files_drirc = files('00-mesa-defaults.conf')
105
106 install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
107
108 if with_tests
109 prog_xmllint = find_program('xmllint', required : false, native : true)
110 if prog_xmllint.found()
111 test(
112 'drirc xml validation',
113 prog_xmllint,
114 args : ['--noout', '--valid', files_drirc],
115 suite : ['util'],
116 )
117 endif
118 endif
119
120 files_xmlconfig = files(
121 'xmlconfig.c',
122 'xmlconfig.h',
123 )
124
125 format_srgb = custom_target(
126 'format_srgb',
127 input : ['format_srgb.py'],
128 output : 'format_srgb.c',
129 command : [prog_python, '@INPUT0@'],
130 capture : true,
131 )
132
133 libmesa_util = static_library(
134 'mesa_util',
135 [files_mesa_util, format_srgb],
136 include_directories : inc_common,
137 dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic, dep_m],
138 c_args : [c_msvc_compat_args, c_vis_args],
139 build_by_default : false
140 )
141
142 libxmlconfig = static_library(
143 'xmlconfig',
144 files_xmlconfig,
145 include_directories : inc_common,
146 link_with : libmesa_util,
147 dependencies : [dep_expat, dep_m],
148 c_args : [
149 c_msvc_compat_args, c_vis_args,
150 '-DSYSCONFDIR="@0@"'.format(
151 join_paths(get_option('prefix'), get_option('sysconfdir'))
152 ),
153 '-DDATADIR="@0@"'.format(
154 join_paths(get_option('prefix'), get_option('datadir'))
155 ),
156 ],
157 build_by_default : false,
158 )
159
160 if with_tests
161 test(
162 'u_atomic',
163 executable(
164 'u_atomic_test',
165 files('u_atomic_test.c'),
166 include_directories : inc_common,
167 link_with : libmesa_util,
168 c_args : [c_msvc_compat_args],
169 ),
170 suite : ['util'],
171 )
172
173 test(
174 'roundeven',
175 executable(
176 'roundeven_test',
177 files('roundeven_test.c'),
178 include_directories : inc_common,
179 c_args : [c_msvc_compat_args],
180 dependencies : [dep_m],
181 ),
182 suite : ['util'],
183 )
184
185 test(
186 'mesa-sha1',
187 executable(
188 'mesa-sha1_test',
189 files('mesa-sha1_test.c'),
190 include_directories : inc_common,
191 link_with : libmesa_util,
192 c_args : [c_msvc_compat_args],
193 ),
194 suite : ['util'],
195 )
196
197 subdir('tests/fast_idiv_by_const')
198 subdir('tests/hash_table')
199 subdir('tests/string_buffer')
200 subdir('tests/vma')
201 subdir('tests/set')
202 endif