meson.build revision 01e04c3f
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
21radv_entrypoints = custom_target(
22  'radv_entrypoints.[ch]',
23  input : ['radv_entrypoints_gen.py', vk_api_xml],
24  output : ['radv_entrypoints.h', 'radv_entrypoints.c'],
25  command : [
26    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--outdir',
27    meson.current_build_dir()
28  ],
29  depend_files : files('radv_extensions.py'),
30)
31
32radv_extensions_c = custom_target(
33  'radv_extensions.c',
34  input : ['radv_extensions.py', vk_api_xml],
35  output : ['radv_extensions.c', 'radv_extensions.h'],
36  command : [
37    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--out-c', '@OUTPUT0@',
38    '--out-h', '@OUTPUT1@'
39  ],
40)
41
42vk_format_table_c = custom_target(
43  'vk_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
51libradv_files = files(
52  'winsys/amdgpu/radv_amdgpu_bo.c',
53  'winsys/amdgpu/radv_amdgpu_bo.h',
54  'winsys/amdgpu/radv_amdgpu_cs.c',
55  'winsys/amdgpu/radv_amdgpu_cs.h',
56  'winsys/amdgpu/radv_amdgpu_surface.c',
57  'winsys/amdgpu/radv_amdgpu_surface.h',
58  'winsys/amdgpu/radv_amdgpu_winsys.c',
59  'winsys/amdgpu/radv_amdgpu_winsys.h',
60  'winsys/amdgpu/radv_amdgpu_winsys_public.h',
61  'radv_cmd_buffer.c',
62  'radv_cs.h',
63  'radv_debug.c',
64  'radv_debug.h',
65  'radv_device.c',
66  'radv_descriptor_set.c',
67  'radv_descriptor_set.h',
68  'radv_formats.c',
69  'radv_image.c',
70  'radv_llvm_helper.cpp',
71  'radv_meta.c',
72  'radv_meta.h',
73  'radv_meta_blit.c',
74  'radv_meta_blit2d.c',
75  'radv_meta_buffer.c',
76  'radv_meta_bufimage.c',
77  'radv_meta_clear.c',
78  'radv_meta_copy.c',
79  'radv_meta_decompress.c',
80  'radv_meta_fast_clear.c',
81  'radv_meta_resolve.c',
82  'radv_meta_resolve_cs.c',
83  'radv_meta_resolve_fs.c',
84  'radv_nir_to_llvm.c',
85  'radv_pass.c',
86  'radv_pipeline.c',
87  'radv_pipeline_cache.c',
88  'radv_private.h',
89  'radv_radeon_winsys.h',
90  'radv_shader.c',
91  'radv_shader.h',
92  'radv_shader_helper.h',
93  'radv_shader_info.c',
94  'radv_query.c',
95  'radv_util.c',
96  'radv_util.h',
97  'radv_wsi.c',
98  'si_cmd_buffer.c',
99  'vk_format.h',
100)
101
102radv_deps = []
103radv_flags = []
104
105if with_platform_x11
106  radv_deps += dep_xcb_dri3
107  radv_flags += [
108    '-DVK_USE_PLATFORM_XCB_KHR',
109    '-DVK_USE_PLATFORM_XLIB_KHR',
110  ]
111  libradv_files += files('radv_wsi_x11.c')
112endif
113
114if with_platform_wayland
115  radv_deps += dep_wayland_client
116  radv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
117  libradv_files += files('radv_wsi_wayland.c')
118endif
119
120if with_platform_drm
121  radv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
122  libradv_files += files('radv_wsi_display.c')
123endif
124
125if with_xlib_lease
126  radv_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
127  radv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
128endif
129
130libvulkan_radeon = shared_library(
131  'vulkan_radeon',
132  [libradv_files, radv_entrypoints, radv_extensions_c, vk_format_table_c, sha1_h],
133  include_directories : [
134    inc_common, inc_amd, inc_amd_common, inc_compiler, inc_vulkan_util,
135    inc_vulkan_wsi,
136  ],
137  link_with : [
138    libamd_common, libamdgpu_addrlib, libvulkan_util, libvulkan_wsi,
139    libmesa_util,
140  ],
141  dependencies : [
142    dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,
143    dep_valgrind, radv_deps,
144    idep_nir,
145  ],
146  c_args : [c_vis_args, no_override_init_args, radv_flags],
147  cpp_args : [cpp_vis_args, radv_flags],
148  link_args : [ld_args_bsymbolic, ld_args_gc_sections],
149  install : true,
150)
151
152radeon_icd = custom_target(
153  'radeon_icd',
154  input : 'radv_icd.py',
155  output : 'radeon_icd.@0@.json'.format(host_machine.cpu()),
156  command : [
157    prog_python, '@INPUT@',
158    '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
159    '--out', '@OUTPUT@',
160  ],
161  depend_files : files('radv_extensions.py'),
162  build_by_default : true,
163  install_dir : with_vulkan_icd_dir,
164  install : true,
165)
166
167radv_dev_icd = custom_target(
168  'radv_dev_icd',
169  input : 'radv_icd.py',
170  output : 'dev_icd.json',
171  command : [
172    prog_python, '@INPUT@', '--lib-path', meson.current_build_dir(),
173    '--out', '@OUTPUT@'
174  ],
175  depend_files : files('radv_extensions.py'),
176  build_by_default : true,
177  install : false,
178)
179