meson: Build i965 and dri stack
[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 'slab.c',
63 'slab.h',
64 'string_buffer.c',
65 'string_buffer.h',
66 'strndup.h',
67 'strtod.c',
68 'strtod.h',
69 'texcompress_rgtc_tmp.h',
70 'u_atomic.c',
71 'u_atomic.h',
72 'u_dynarray.h',
73 'u_endian.h',
74 'u_queue.c',
75 'u_queue.h',
76 'u_string.h',
77 'u_thread.h',
78 'u_vector.c',
79 'u_vector.h',
80 )
81
82 install_data('drirc', install_dir : get_option('sysconfdir'))
83
84 files_xmlconfig = files(
85 'xmlconfig.c',
86 'xmlconfig.h',
87 )
88
89 format_srgb = custom_target(
90 'format_srgb',
91 input : ['format_srgb.py'],
92 output : 'format_srgb.c',
93 command : [prog_python2, '@INPUT0@'],
94 capture : true,
95 )
96
97 libmesa_util = static_library(
98 'mesa_util',
99 [files_mesa_util, format_srgb],
100 include_directories : inc_common,
101 dependencies : [dep_zlib, dep_clock],
102 c_args : [c_msvc_compat_args, c_vis_args],
103 build_by_default : false
104 )
105
106 libxmlconfig = static_library(
107 'xmlconfig',
108 files_xmlconfig,
109 include_directories : inc_common,
110 dependencies : [dep_expat, dep_m],
111 c_args : [c_msvc_compat_args, c_vis_args,
112 '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))],
113 build_by_default : false,
114 )
115
116 if with_tests
117 u_atomic_test = executable(
118 'u_atomic_test',
119 files('u_atomic_test.c'),
120 include_directories : inc_common,
121 link_with : libmesa_util,
122 c_args : [c_msvc_compat_args],
123 )
124
125 roundeven_test = executable(
126 'roundeven_test',
127 files('roundeven_test.c'),
128 include_directories : inc_common,
129 c_args : [c_msvc_compat_args],
130 dependencies : [dep_m],
131 )
132
133 test('u_atomic', u_atomic_test)
134 test('roundeven', roundeven_test)
135
136 subdir('tests/hash_table')
137 subdir('tests/string_buffer')
138 endif