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