turnip: add x11 wsi
[mesa.git] / src / freedreno / vulkan / 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 tu_entrypoints = custom_target(
22 'tu_entrypoints.[ch]',
23 input : ['tu_entrypoints_gen.py', vk_api_xml],
24 output : ['tu_entrypoints.h', 'tu_entrypoints.c'],
25 command : [
26 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--outdir',
27 meson.current_build_dir()
28 ],
29 depend_files : files('tu_extensions.py'),
30 )
31
32 tu_extensions_c = custom_target(
33 'tu_extensions.c',
34 input : ['tu_extensions.py', vk_api_xml],
35 output : ['tu_extensions.c', 'tu_extensions.h'],
36 command : [
37 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--out-c', '@OUTPUT0@',
38 '--out-h', '@OUTPUT1@'
39 ],
40 )
41
42 tu_format_table_c = custom_target(
43 'tu_format_table.c',
44 input : ['vk_format_table.py', 'vk_format_layout.csv'],
45 output : 'vk_format_table.c',
46 command : [prog_python, '@INPUT@'],
47 depend_files : files('vk_format_parse.py'),
48 capture : true,
49 )
50
51 libtu_files = files(
52 'tu_blit.c',
53 'tu_blit.h',
54 'tu_cmd_buffer.c',
55 'tu_cs.c',
56 'tu_cs.h',
57 'tu_device.c',
58 'tu_descriptor_set.c',
59 'tu_descriptor_set.h',
60 'tu_drm.c',
61 'tu_fence.c',
62 'tu_formats.c',
63 'tu_image.c',
64 'tu_meta_blit.c',
65 'tu_meta_buffer.c',
66 'tu_meta_clear.c',
67 'tu_meta_copy.c',
68 'tu_meta_resolve.c',
69 'tu_pass.c',
70 'tu_pipeline.c',
71 'tu_pipeline_cache.c',
72 'tu_private.h',
73 'tu_query.c',
74 'tu_shader.c',
75 'tu_util.c',
76 'tu_util.h',
77 'tu_wsi.c',
78 'vk_format.h',
79 )
80
81 tu_deps = []
82 tu_flags = []
83
84 if with_platform_x11
85 tu_deps += dep_xcb_dri3
86 tu_flags += [
87 '-DVK_USE_PLATFORM_XCB_KHR',
88 '-DVK_USE_PLATFORM_XLIB_KHR',
89 ]
90 libtu_files += files('tu_wsi_x11.c')
91 endif
92
93 if with_platform_wayland
94 tu_deps += dep_wayland_client
95 tu_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
96 libtu_files += files('tu_wsi_wayland.c')
97 endif
98
99 if with_platform_drm
100 tu_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
101 libtu_files += files('tu_wsi_display.c')
102 endif
103
104 if with_xlib_lease
105 tu_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
106 tu_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
107 endif
108
109 libvulkan_freedreno = shared_library(
110 'vulkan_freedreno',
111 [libtu_files, tu_entrypoints, tu_extensions_c, tu_format_table_c, freedreno_xml_header_files],
112 include_directories : [
113 inc_common,
114 inc_compiler,
115 inc_vulkan_wsi,
116 inc_freedreno,
117 ],
118 link_with : [
119 libvulkan_wsi,
120 libfreedreno_drm, # required by ir3_shader_get_variant, which we don't use
121 libfreedreno_ir3,
122 ],
123 dependencies : [
124 dep_dl,
125 dep_elf,
126 dep_libdrm,
127 dep_llvm,
128 dep_m,
129 dep_thread,
130 dep_valgrind,
131 idep_nir,
132 tu_deps,
133 idep_vulkan_util,
134 idep_mesautil,
135 ],
136 c_args : [c_vis_args, no_override_init_args, tu_flags],
137 link_args : [ld_args_bsymbolic, ld_args_gc_sections],
138 install : true,
139 )
140
141 if with_symbols_check
142 test(
143 'tu symbols check',
144 symbols_check,
145 args : [
146 '--lib', libvulkan_freedreno,
147 '--symbols-file', vulkan_icd_symbols,
148 symbols_check_args,
149 ],
150 suite : ['freedreno'],
151 )
152 endif
153
154 freedreno_icd = custom_target(
155 'freedreno_icd',
156 input : 'tu_icd.py',
157 output : 'freedreno_icd.@0@.json'.format(host_machine.cpu()),
158 command : [
159 prog_python, '@INPUT@',
160 '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
161 '--out', '@OUTPUT@',
162 ],
163 depend_files : files('tu_extensions.py'),
164 build_by_default : true,
165 install_dir : with_vulkan_icd_dir,
166 install : true,
167 )