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