1bf215546Sopenharmony_ci
2bf215546Sopenharmony_ci
3bf215546Sopenharmony_cilibvulkan_lvp = shared_library(
4bf215546Sopenharmony_ci  'vulkan_lvp',
5bf215546Sopenharmony_ci  [ 'target.c' ],
6bf215546Sopenharmony_ci  vs_module_defs : vulkan_api_def,
7bf215546Sopenharmony_ci  include_directories : [ inc_src, inc_util, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_winsys, inc_gallium_drivers ],
8bf215546Sopenharmony_ci  link_whole : [ liblavapipe_st ],
9bf215546Sopenharmony_ci  link_with : [libpipe_loader_static, libgallium, libwsw, libswdri, libws_null, libswkmsdri ],
10bf215546Sopenharmony_ci  gnu_symbol_visibility : 'hidden',
11bf215546Sopenharmony_ci  link_args : [ld_args_bsymbolic, ld_args_gc_sections],
12bf215546Sopenharmony_ci  dependencies : driver_swrast,
13bf215546Sopenharmony_ci  name_prefix : host_machine.system() == 'windows' ? '' : 'lib',
14bf215546Sopenharmony_ci  install : true,
15bf215546Sopenharmony_ci)
16bf215546Sopenharmony_ci
17bf215546Sopenharmony_ciicd_file_name = 'libvulkan_lvp.so'
18bf215546Sopenharmony_cimodule_dir = join_paths(get_option('prefix'), get_option('libdir'))
19bf215546Sopenharmony_ciif with_platform_windows
20bf215546Sopenharmony_ci  module_dir = join_paths(get_option('prefix'), get_option('bindir'))
21bf215546Sopenharmony_ci  icd_file_name = 'vulkan_lvp.dll'
22bf215546Sopenharmony_ciendif
23bf215546Sopenharmony_ci
24bf215546Sopenharmony_ciicd_command = [
25bf215546Sopenharmony_ci  prog_python, '@INPUT0@',
26bf215546Sopenharmony_ci  '--api-version', '1.1', '--xml', '@INPUT1@',
27bf215546Sopenharmony_ci  '--lib-path', join_paths(module_dir, icd_file_name),
28bf215546Sopenharmony_ci  '--out', '@OUTPUT@',
29bf215546Sopenharmony_ci]
30bf215546Sopenharmony_ciif with_platform_windows
31bf215546Sopenharmony_ci  icd_command += '--use-backslash'
32bf215546Sopenharmony_ciendif
33bf215546Sopenharmony_ci
34bf215546Sopenharmony_cilvp_icd = custom_target(
35bf215546Sopenharmony_ci  'lvp_icd',
36bf215546Sopenharmony_ci  input : [vk_icd_gen, vk_api_xml],
37bf215546Sopenharmony_ci  output : 'lvp_icd.@0@.json'.format(host_machine.cpu()),
38bf215546Sopenharmony_ci  command : icd_command,
39bf215546Sopenharmony_ci  build_by_default : true,
40bf215546Sopenharmony_ci  install_dir : with_vulkan_icd_dir,
41bf215546Sopenharmony_ci  install : true,
42bf215546Sopenharmony_ci)
43bf215546Sopenharmony_ci
44bf215546Sopenharmony_ciif meson.version().version_compare('>= 0.58')
45bf215546Sopenharmony_ci  _dev_icdname = 'lvp_devenv_icd.@0@.json'.format(host_machine.cpu())
46bf215546Sopenharmony_ci  custom_target(
47bf215546Sopenharmony_ci    'lvp_devenv_icd',
48bf215546Sopenharmony_ci    input : [vk_icd_gen, vk_api_xml],
49bf215546Sopenharmony_ci    output : _dev_icdname,
50bf215546Sopenharmony_ci    command : [
51bf215546Sopenharmony_ci      prog_python, '@INPUT0@',
52bf215546Sopenharmony_ci      '--api-version', '1.1', '--xml', '@INPUT1@',
53bf215546Sopenharmony_ci      '--lib-path', meson.current_build_dir() / 'libvulkan_lvp.so',
54bf215546Sopenharmony_ci      '--out', '@OUTPUT@',
55bf215546Sopenharmony_ci    ],
56bf215546Sopenharmony_ci    build_by_default : true,
57bf215546Sopenharmony_ci  )
58bf215546Sopenharmony_ci
59bf215546Sopenharmony_ci  devenv.append('VK_ICD_FILENAMES', meson.current_build_dir() / _dev_icdname)
60bf215546Sopenharmony_ciendif
61