util: import public domain code for integer division by a constant
[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 'debug.c',
35 'debug.h',
36 'disk_cache.c',
37 'disk_cache.h',
38 'fast_idiv_by_const.c',
39 'fast_idiv_by_const.h',
40 'format_r11g11b10f.h',
41 'format_rgb9e5.h',
42 'format_srgb.h',
43 'futex.h',
44 'half_float.c',
45 'half_float.h',
46 'hash_table.c',
47 'hash_table.h',
48 'list.h',
49 'macros.h',
50 'mesa-sha1.c',
51 'mesa-sha1.h',
52 'os_time.c',
53 'os_time.h',
54 'u_process.c',
55 'u_process.h',
56 'sha1/sha1.c',
57 'sha1/sha1.h',
58 'ralloc.c',
59 'ralloc.h',
60 'rand_xor.c',
61 'rand_xor.h',
62 'rb_tree.c',
63 'rb_tree.h',
64 'register_allocate.c',
65 'register_allocate.h',
66 'rgtc.c',
67 'rgtc.h',
68 'rounding.h',
69 'set.c',
70 'set.h',
71 'simple_list.h',
72 'simple_mtx.h',
73 'slab.c',
74 'slab.h',
75 'string_buffer.c',
76 'string_buffer.h',
77 'strndup.h',
78 'strtod.c',
79 'strtod.h',
80 'texcompress_rgtc_tmp.h',
81 'u_atomic.c',
82 'u_atomic.h',
83 'u_dynarray.h',
84 'u_endian.h',
85 'u_queue.c',
86 'u_queue.h',
87 'u_string.h',
88 'u_thread.h',
89 'u_vector.c',
90 'u_vector.h',
91 'u_math.c',
92 'u_math.h',
93 'vma.c',
94 'vma.h',
95 )
96
97 install_data('00-mesa-defaults.conf', install_dir : join_paths(get_option('datadir'), 'drirc.d'))
98
99 files_xmlconfig = files(
100 'xmlconfig.c',
101 'xmlconfig.h',
102 )
103
104 format_srgb = custom_target(
105 'format_srgb',
106 input : ['format_srgb.py'],
107 output : 'format_srgb.c',
108 command : [prog_python, '@INPUT0@'],
109 capture : true,
110 )
111
112 libmesa_util = static_library(
113 'mesa_util',
114 [files_mesa_util, format_srgb],
115 include_directories : inc_common,
116 dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic],
117 c_args : [c_msvc_compat_args, c_vis_args],
118 build_by_default : false
119 )
120
121 libxmlconfig = static_library(
122 'xmlconfig',
123 files_xmlconfig,
124 include_directories : inc_common,
125 link_with : libmesa_util,
126 dependencies : [dep_expat, dep_m],
127 c_args : [
128 c_msvc_compat_args, c_vis_args,
129 '-DSYSCONFDIR="@0@"'.format(
130 join_paths(get_option('prefix'), get_option('sysconfdir'))
131 ),
132 '-DDATADIR="@0@"'.format(
133 join_paths(get_option('prefix'), get_option('datadir'))
134 ),
135 ],
136 build_by_default : false,
137 )
138
139 if with_tests
140 test(
141 'u_atomic',
142 executable(
143 'u_atomic_test',
144 files('u_atomic_test.c'),
145 include_directories : inc_common,
146 link_with : libmesa_util,
147 c_args : [c_msvc_compat_args],
148 )
149 )
150
151 test(
152 'roundeven',
153 executable(
154 'roundeven_test',
155 files('roundeven_test.c'),
156 include_directories : inc_common,
157 c_args : [c_msvc_compat_args],
158 dependencies : [dep_m],
159 )
160 )
161
162 test(
163 'mesa-sha1',
164 executable(
165 'mesa-sha1_test',
166 files('mesa-sha1_test.c'),
167 include_directories : inc_common,
168 link_with : libmesa_util,
169 c_args : [c_msvc_compat_args],
170 )
171 )
172
173 subdir('tests/hash_table')
174 subdir('tests/string_buffer')
175 subdir('tests/vma')
176 subdir('tests/set')
177 endif