1# Copyright © 2017 Intel Corporation 2# SPDX-License-Identifier: MIT 3 4files_vulkan_wsi = files('wsi_common.c') 5links_vulkan_wsi = [] 6platform_deps = [] 7 8if dep_libdrm.found() 9 files_vulkan_wsi += files('wsi_common_drm.c') 10endif 11 12if with_platform_x11 13 files_vulkan_wsi += files('wsi_common_x11.c') 14endif 15 16if with_platform_wayland 17 files_vulkan_wsi += files('wsi_common_wayland.c') 18 files_vulkan_wsi += wp_files['fifo-v1'] 19 files_vulkan_wsi += wp_files['commit-timing-v1'] 20 files_vulkan_wsi += wp_files['linux-dmabuf-unstable-v1'] 21 files_vulkan_wsi += wp_files['presentation-time'] 22 files_vulkan_wsi += wp_files['tearing-control-v1'] 23 links_vulkan_wsi += libloader_wayland_helper 24 files_vulkan_wsi += wp_files['linux-drm-syncobj-v1'] 25endif 26 27if with_platform_windows 28 files_vulkan_wsi += files('wsi_common_win32.cpp') 29 platform_deps += dep_dxheaders 30else 31 files_vulkan_wsi += files('wsi_common_headless.c') 32endif 33 34if with_platform_macos 35 files_vulkan_wsi += files('wsi_common_metal.c', 'wsi_common_metal_layer.m') 36endif 37 38if system_has_kms_drm and not with_platform_android 39 files_vulkan_wsi += files('wsi_common_display.c') 40endif 41 42wsi_entrypoints = custom_target( 43 'wsi_entrypoints', 44 input : [vk_entrypoints_gen, vk_api_xml], 45 output : ['wsi_common_entrypoints.h', 'wsi_common_entrypoints.c'], 46 command : [ 47 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak', 48 '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'wsi', 49 '--beta', with_vulkan_beta.to_string() 50 ], 51 depend_files : vk_entrypoints_gen_depend_files, 52) 53 54libvulkan_wsi = static_library( 55 'vulkan_wsi', 56 [files_vulkan_wsi, wsi_entrypoints], 57 include_directories : [inc_include, inc_src], 58 dependencies : [ 59 vulkan_wsi_deps, dep_libdrm, dep_libudev, idep_vulkan_util_headers, 60 idep_vulkan_runtime_headers, idep_xmlconfig, idep_mesautil, platform_deps, 61 idep_blake3 62 ], 63 link_with: links_vulkan_wsi, 64 gnu_symbol_visibility : 'hidden', 65 build_by_default : false, 66) 67 68idep_vulkan_wsi_headers = declare_dependency( 69 sources : wsi_entrypoints[0], 70 dependencies : idep_vulkan_wsi_defines, 71 include_directories : include_directories('.') 72) 73 74# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine. 75# See this discussion here: 76# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506 77if get_option('backend').startswith('vs') 78 idep_vulkan_wsi = declare_dependency( 79 link_with : libvulkan_wsi, 80 dependencies : idep_vulkan_wsi_headers 81 ) 82else 83 idep_vulkan_wsi = declare_dependency( 84 # Instruct users of this library to link with --whole-archive. Otherwise, 85 # our weak function overloads may not resolve properly. 86 link_whole : libvulkan_wsi, 87 dependencies : [ 88 idep_vulkan_wsi_headers, dep_libudev 89 ] 90 ) 91endif 92