~mmach/netext73/mesa-haswell

« back to all changes in this revision

Viewing changes to src/amd/vulkan/meson.build

  • Committer: mmach
  • Date: 2022-09-22 19:56:13 UTC
  • Revision ID: netbit73@gmail.com-20220922195613-wtik9mmy20tmor0i
2022-09-22 21:17:09

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
radv_entrypoints = custom_target(
22
 
  'radv_entrypoints',
23
 
  input : [vk_entrypoints_gen, vk_api_xml],
24
 
  output : ['radv_entrypoints.h', 'radv_entrypoints.c'],
25
 
  command : [
26
 
    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
27
 
    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'radv',
28
 
    '--device-prefix', 'sqtt', '--device-prefix', 'metro_exodus',
29
 
  ],
30
 
  depend_files : vk_entrypoints_gen_depend_files,
31
 
)
32
 
 
33
 
libradv_files = files(
34
 
  'layers/radv_metro_exodus.c',
35
 
  'layers/radv_sqtt_layer.c',
36
 
  'winsys/null/radv_null_bo.c',
37
 
  'winsys/null/radv_null_bo.h',
38
 
  'winsys/null/radv_null_cs.c',
39
 
  'winsys/null/radv_null_cs.h',
40
 
  'winsys/null/radv_null_winsys.c',
41
 
  'winsys/null/radv_null_winsys_public.h',
42
 
  'radv_acceleration_structure.c',
43
 
  'radv_acceleration_structure.h',
44
 
  'radv_android.c',
45
 
  'radv_cmd_buffer.c',
46
 
  'radv_cs.h',
47
 
  'radv_debug.c',
48
 
  'radv_debug.h',
49
 
  'radv_device.c',
50
 
  'radv_descriptor_set.c',
51
 
  'radv_descriptor_set.h',
52
 
  'radv_formats.c',
53
 
  'radv_image.c',
54
 
  'radv_meta.c',
55
 
  'radv_meta.h',
56
 
  'radv_meta_blit.c',
57
 
  'radv_meta_blit2d.c',
58
 
  'radv_meta_buffer.c',
59
 
  'radv_meta_bufimage.c',
60
 
  'radv_meta_clear.c',
61
 
  'radv_meta_copy.c',
62
 
  'radv_meta_copy_vrs_htile.c',
63
 
  'radv_meta_dcc_retile.c',
64
 
  'radv_meta_decompress.c',
65
 
  'radv_meta_etc_decode.c',
66
 
  'radv_meta_fast_clear.c',
67
 
  'radv_meta_fmask_copy.c',
68
 
  'radv_meta_fmask_expand.c',
69
 
  'radv_meta_resolve.c',
70
 
  'radv_meta_resolve_cs.c',
71
 
  'radv_meta_resolve_fs.c',
72
 
  'radv_nir_apply_pipeline_layout.c',
73
 
  'radv_nir_lower_ray_queries.c',
74
 
  'radv_nir_lower_ycbcr_textures.c',
75
 
  'radv_pass.c',
76
 
  'radv_perfcounter.c',
77
 
  'radv_pipeline.c',
78
 
  'radv_pipeline_cache.c',
79
 
  'radv_pipeline_rt.c',
80
 
  'radv_private.h',
81
 
  'radv_radeon_winsys.h',
82
 
  'radv_rt_common.c',
83
 
  'radv_sdma_copy_image.c',
84
 
  'radv_shader.c',
85
 
  'radv_shader.h',
86
 
  'radv_shader_args.c',
87
 
  'radv_shader_args.h',
88
 
  'radv_shader_info.c',
89
 
  'radv_spm.c',
90
 
  'radv_sqtt.c',
91
 
  'radv_query.c',
92
 
  'radv_wsi.c',
93
 
  'si_cmd_buffer.c',
94
 
  'vk_format.h',
95
 
)
96
 
 
97
 
files_drirc = files('00-radv-defaults.conf')
98
 
 
99
 
install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
100
 
 
101
 
if not with_platform_windows
102
 
  libradv_files += files(
103
 
    'winsys/amdgpu/radv_amdgpu_bo.c',
104
 
    'winsys/amdgpu/radv_amdgpu_bo.h',
105
 
    'winsys/amdgpu/radv_amdgpu_cs.c',
106
 
    'winsys/amdgpu/radv_amdgpu_cs.h',
107
 
    'winsys/amdgpu/radv_amdgpu_surface.c',
108
 
    'winsys/amdgpu/radv_amdgpu_surface.h',
109
 
    'winsys/amdgpu/radv_amdgpu_winsys.c',
110
 
    'winsys/amdgpu/radv_amdgpu_winsys.h',
111
 
    'winsys/amdgpu/radv_amdgpu_winsys_public.h',
112
 
  )
113
 
endif
114
 
 
115
 
if with_llvm
116
 
  libradv_files += files(
117
 
    'radv_llvm_helper.cpp',
118
 
    'radv_llvm_helper.h',
119
 
    'radv_nir_to_llvm.c',
120
 
  )
121
 
endif
122
 
 
123
 
radv_deps = []
124
 
radv_flags = cc.get_supported_arguments(['-Wimplicit-fallthrough', '-Wshadow'])
125
 
 
126
 
if with_platform_x11
127
 
  radv_deps += dep_xcb_dri3
128
 
endif
129
 
 
130
 
if with_platform_wayland
131
 
  radv_deps += dep_wayland_client
132
 
endif
133
 
 
134
 
if with_xlib_lease
135
 
  radv_deps += [dep_xlib_xrandr]
136
 
endif
137
 
 
138
 
if with_platform_android
139
 
  radv_deps += dep_android
140
 
endif
141
 
 
142
 
# When static linking LLVM, all its symbols are public API.
143
 
# That may cause symbol collision, so explicitly demote everything.
144
 
libvulkan_radeon_ld_args = []
145
 
libvulkan_radeon_link_depends = []
146
 
 
147
 
if with_ld_version_script
148
 
  libvulkan_radeon_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'vulkan.sym')]
149
 
  libvulkan_radeon_link_depends += files('vulkan.sym')
150
 
endif
151
 
 
152
 
vulkan_radv_def = 'vulkan_radv.def'
153
 
 
154
 
libvulkan_radeon = shared_library(
155
 
  'vulkan_radeon',
156
 
  [libradv_files, radv_entrypoints, sha1_h],
157
 
  vs_module_defs : vulkan_radv_def,
158
 
  include_directories : [
159
 
    inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_amd, inc_amd_common, inc_amd_common_llvm, inc_compiler, inc_util,
160
 
  ],
161
 
  link_with : [
162
 
    libamd_common, libamd_common_llvm, libamdgpu_addrlib,
163
 
  ],
164
 
  dependencies : [
165
 
    dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,
166
 
    dep_valgrind, radv_deps, idep_aco,
167
 
    idep_mesautil, idep_nir, idep_vulkan_util, idep_vulkan_wsi,
168
 
    idep_vulkan_runtime, idep_amdgfxregs_h, idep_xmlconfig,
169
 
    idep_vulkan_common_entrypoints_h
170
 
  ],
171
 
  c_args : [no_override_init_args, radv_flags, c_msvc_compat_args],
172
 
  cpp_args : [radv_flags, cpp_msvc_compat_args],
173
 
  link_args : [
174
 
    ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections, libvulkan_radeon_ld_args,
175
 
  ],
176
 
  link_depends : [libvulkan_radeon_link_depends,],
177
 
  gnu_symbol_visibility : 'hidden',
178
 
  install : true,
179
 
)
180
 
 
181
 
if with_symbols_check
182
 
  test(
183
 
    'radv symbols check',
184
 
    symbols_check,
185
 
    args : [
186
 
      '--lib', libvulkan_radeon,
187
 
      '--symbols-file', vulkan_icd_symbols,
188
 
      '--ignore-symbol', 'ac_init_shared_llvm_once',
189
 
      symbols_check_args,
190
 
    ],
191
 
    suite : ['amd'],
192
 
  )
193
 
endif
194
 
 
195
 
icd_lib_path = join_paths(get_option('prefix'), get_option('libdir'))
196
 
icd_file_name = 'libvulkan_radeon.so'
197
 
if with_platform_windows
198
 
  icd_lib_path = '.'
199
 
  icd_file_name = 'vulkan_radeon.dll'
200
 
endif
201
 
 
202
 
icd_command = [
203
 
  prog_python, '@INPUT0@',
204
 
  '--api-version', '1.3', '--xml', '@INPUT1@',
205
 
  '--lib-path', join_paths(icd_lib_path, icd_file_name),
206
 
  '--out', '@OUTPUT@',
207
 
]
208
 
if with_platform_windows
209
 
  icd_command += '--use-backslash'
210
 
endif
211
 
 
212
 
radeon_icd = custom_target(
213
 
  'radeon_icd',
214
 
  input : [vk_icd_gen, vk_api_xml],
215
 
  output : 'radeon_icd.@0@.json'.format(host_machine.cpu()),
216
 
  command : icd_command,
217
 
  build_by_default : true,
218
 
  install_dir : with_vulkan_icd_dir,
219
 
  install : true,
220
 
)
221
 
 
222
 
if meson.version().version_compare('>= 0.58')
223
 
  _dev_icdname = 'radeon_devenv_icd.@0@.json'.format(host_machine.cpu())
224
 
  custom_target(
225
 
    'radeon_devenv_icd',
226
 
    input : [vk_icd_gen, vk_api_xml],
227
 
    output : _dev_icdname,
228
 
    command : [
229
 
      prog_python, '@INPUT0@',
230
 
      '--api-version', '1.3', '--xml', '@INPUT1@',
231
 
      '--lib-path', meson.current_build_dir() / icd_file_name,
232
 
      '--out', '@OUTPUT@',
233
 
    ],
234
 
    build_by_default : true,
235
 
  )
236
 
 
237
 
  devenv.append('VK_ICD_FILENAMES', meson.current_build_dir() / _dev_icdname)
238
 
endif