0145d9cbe3330ffa73803088d38b34cb2ba5a1bc
[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 'half_float.c',
41 'half_float.h',
42 'hash_table.c',
43 'hash_table.h',
44 'list.h',
45 'macros.h',
46 'mesa-sha1.c',
47 'mesa-sha1.h',
48 'sha1/sha1.c',
49 'sha1/sha1.h',
50 'ralloc.c',
51 'ralloc.h',
52 'rand_xor.c',
53 'rand_xor.h',
54 'register_allocate.c',
55 'register_allocate.h',
56 'rgtc.c',
57 'rgtc.h',
58 'rounding.h',
59 'set.c',
60 'set.h',
61 'simple_list.h',
62 'simple_mtx.h',
63 'slab.c',
64 'slab.h',
65 'string_buffer.c',
66 'string_buffer.h',
67 'strndup.h',
68 'strtod.c',
69 'strtod.h',
70 'texcompress_rgtc_tmp.h',
71 'u_atomic.c',
72 'u_atomic.h',
73 'u_dynarray.h',
74 'u_endian.h',
75 'u_queue.c',
76 'u_queue.h',
77 'u_string.h',
78 'u_thread.h',
79 'u_vector.c',
80 'u_vector.h',
81 )
82
83 install_data('drirc', install_dir : get_option('sysconfdir'))
84
85 files_xmlconfig = files(
86 'xmlconfig.c',
87 'xmlconfig.h',
88 )
89
90 format_srgb = custom_target(
91 'format_srgb',
92 input : ['format_srgb.py'],
93 output : 'format_srgb.c',
94 command : [prog_python2, '@INPUT0@'],
95 capture : true,
96 )
97
98 libmesa_util = static_library(
99 'mesa_util',
100 [files_mesa_util, format_srgb],
101 include_directories : inc_common,
102 dependencies : [dep_zlib, dep_clock],
103 c_args : [c_msvc_compat_args, c_vis_args],
104 build_by_default : false
105 )
106
107 libxmlconfig = static_library(
108 'xmlconfig',
109 files_xmlconfig,
110 include_directories : inc_common,
111 dependencies : [dep_expat, dep_m],
112 c_args : [c_msvc_compat_args, c_vis_args,
113 '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))],
114 build_by_default : false,
115 )
116
117 if with_tests
118 u_atomic_test = executable(
119 'u_atomic_test',
120 files('u_atomic_test.c'),
121 include_directories : inc_common,
122 link_with : libmesa_util,
123 c_args : [c_msvc_compat_args],
124 )
125
126 roundeven_test = executable(
127 'roundeven_test',
128 files('roundeven_test.c'),
129 include_directories : inc_common,
130 c_args : [c_msvc_compat_args],
131 dependencies : [dep_m],
132 )
133
134 test('u_atomic', u_atomic_test)
135 test('roundeven', roundeven_test)
136
137 subdir('tests/hash_table')
138 subdir('tests/string_buffer')
139 endif