54024b4d11b45dbdd58cc4d6f5cbd8b77b043350
[mesa.git] / src / intel / isl / 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 isl_gen_files = files(
22 'isl_emit_depth_stencil.c',
23 'isl_surface_state.c',
24 )
25
26 isl_gen4_files = files(
27 'isl_gen4.c',
28 'isl_gen4.h',
29 )
30
31 isl_gen6_files = files(
32 'isl_gen6.c',
33 'isl_gen6.h',
34 )
35
36 isl_gen7_files = files(
37 'isl_gen7.c',
38 'isl_gen7.h',
39 )
40
41 isl_gen8_files = files(
42 'isl_gen8.c',
43 'isl_gen8.h',
44 )
45
46 isl_gen9_files = files(
47 'isl_gen9.c',
48 'isl_gen9.h',
49 )
50
51 isl_gen_libs = []
52 foreach g : [['40', isl_gen4_files], ['50', []], ['60', isl_gen6_files],
53 ['70', isl_gen7_files], ['75', []], ['80', isl_gen8_files],
54 ['90', isl_gen9_files], ['100', []]]
55 _gen = g[0]
56 _sources = g[1]
57 _lib = static_library(
58 'libisl_gen@0@'.format(_gen),
59 [_sources, isl_gen_files, gen_xml_pack],
60 include_directories : [inc_common, inc_intel],
61 c_args : [c_vis_args, no_override_init_args,
62 '-DGEN_VERSIONx10=@0@'.format(_gen)],
63 build_by_default : false,
64 )
65 isl_gen_libs += _lib
66 endforeach
67
68 isl_format_layout_c = custom_target(
69 'isl_format_layout.c',
70 input : ['gen_format_layout.py', 'isl_format_layout.csv'],
71 output : 'isl_format_layout.c',
72 command : [prog_python2, '@INPUT0@', '--csv', '@INPUT1@', '--out', '@OUTPUT@'],
73 )
74
75 libisl_files = files(
76 'isl.c',
77 'isl.h',
78 'isl_drm.c',
79 'isl_genX_priv.h',
80 'isl_format.c',
81 'isl_priv.h',
82 'isl_storage_image.c',
83 )
84
85 libisl = static_library(
86 'isl',
87 [libisl_files, isl_format_layout_c, genX_bits_h],
88 include_directories : [inc_common, inc_intel, inc_drm_uapi],
89 link_with : isl_gen_libs,
90 c_args : [c_vis_args, no_override_init_args],
91 build_by_default : false,
92 )
93
94 if with_tests
95 isl_surf_get_image_offset_test = executable(
96 'isl_surf_get_image_offset_test',
97 'tests/isl_surf_get_image_offset_test.c',
98 dependencies : dep_m,
99 include_directories : [inc_common, inc_intel],
100 link_with : [libisl, libintel_common],
101 build_by_default : false,
102 )
103
104 test('isl_surf_get_image_offset', isl_surf_get_image_offset_test)
105 endif