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