1bf215546Sopenharmony_ci# Copyright © 2017 Intel Corporation 2bf215546Sopenharmony_ci 3bf215546Sopenharmony_ci# Permission is hereby granted, free of charge, to any person obtaining a copy 4bf215546Sopenharmony_ci# of this software and associated documentation files (the "Software"), to deal 5bf215546Sopenharmony_ci# in the Software without restriction, including without limitation the rights 6bf215546Sopenharmony_ci# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7bf215546Sopenharmony_ci# copies of the Software, and to permit persons to whom the Software is 8bf215546Sopenharmony_ci# furnished to do so, subject to the following conditions: 9bf215546Sopenharmony_ci 10bf215546Sopenharmony_ci# The above copyright notice and this permission notice shall be included in 11bf215546Sopenharmony_ci# all copies or substantial portions of the Software. 12bf215546Sopenharmony_ci 13bf215546Sopenharmony_ci# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14bf215546Sopenharmony_ci# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15bf215546Sopenharmony_ci# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16bf215546Sopenharmony_ci# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17bf215546Sopenharmony_ci# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18bf215546Sopenharmony_ci# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19bf215546Sopenharmony_ci# SOFTWARE. 20bf215546Sopenharmony_ci 21bf215546Sopenharmony_cifiles_vulkan_wsi = files('wsi_common.c') 22bf215546Sopenharmony_ci 23bf215546Sopenharmony_ciif dep_libdrm.found() 24bf215546Sopenharmony_ci files_vulkan_wsi += files('wsi_common_drm.c') 25bf215546Sopenharmony_ciendif 26bf215546Sopenharmony_ci 27bf215546Sopenharmony_ciif with_platform_x11 28bf215546Sopenharmony_ci files_vulkan_wsi += files('wsi_common_x11.c') 29bf215546Sopenharmony_ciendif 30bf215546Sopenharmony_ci 31bf215546Sopenharmony_ciif with_platform_wayland 32bf215546Sopenharmony_ci files_vulkan_wsi += files('wsi_common_wayland.c') 33bf215546Sopenharmony_ci files_vulkan_wsi += [ 34bf215546Sopenharmony_ci linux_dmabuf_unstable_v1_client_protocol_h, 35bf215546Sopenharmony_ci linux_dmabuf_unstable_v1_protocol_c, 36bf215546Sopenharmony_ci ] 37bf215546Sopenharmony_ciendif 38bf215546Sopenharmony_ci 39bf215546Sopenharmony_ciif with_platform_windows 40bf215546Sopenharmony_ci files_vulkan_wsi += files('wsi_common_win32.c') 41bf215546Sopenharmony_ciendif 42bf215546Sopenharmony_ci 43bf215546Sopenharmony_ciif system_has_kms_drm and not with_platform_android 44bf215546Sopenharmony_ci files_vulkan_wsi += files('wsi_common_display.c') 45bf215546Sopenharmony_ciendif 46bf215546Sopenharmony_ci 47bf215546Sopenharmony_ciwsi_entrypoints = custom_target( 48bf215546Sopenharmony_ci 'wsi_entrypoints', 49bf215546Sopenharmony_ci input : [vk_entrypoints_gen, vk_api_xml], 50bf215546Sopenharmony_ci output : ['wsi_common_entrypoints.h', 'wsi_common_entrypoints.c'], 51bf215546Sopenharmony_ci command : [ 52bf215546Sopenharmony_ci prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak', 53bf215546Sopenharmony_ci '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'wsi', 54bf215546Sopenharmony_ci ], 55bf215546Sopenharmony_ci depend_files : vk_entrypoints_gen_depend_files, 56bf215546Sopenharmony_ci) 57bf215546Sopenharmony_ci 58bf215546Sopenharmony_cilibvulkan_wsi = static_library( 59bf215546Sopenharmony_ci 'vulkan_wsi', 60bf215546Sopenharmony_ci [files_vulkan_wsi, wsi_entrypoints], 61bf215546Sopenharmony_ci include_directories : [inc_include, inc_src, inc_gallium], 62bf215546Sopenharmony_ci dependencies : [ 63bf215546Sopenharmony_ci vulkan_wsi_deps, dep_libdrm, dep_libudev, idep_vulkan_util_headers, 64bf215546Sopenharmony_ci idep_vulkan_runtime_headers, idep_xmlconfig, 65bf215546Sopenharmony_ci ], 66bf215546Sopenharmony_ci gnu_symbol_visibility : 'hidden', 67bf215546Sopenharmony_ci build_by_default : false, 68bf215546Sopenharmony_ci) 69bf215546Sopenharmony_ci 70bf215546Sopenharmony_ciidep_vulkan_wsi_headers = declare_dependency( 71bf215546Sopenharmony_ci include_directories : include_directories('.') 72bf215546Sopenharmony_ci) 73bf215546Sopenharmony_ci 74bf215546Sopenharmony_ci# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine. 75bf215546Sopenharmony_ci# See this discussion here: 76bf215546Sopenharmony_ci# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506 77bf215546Sopenharmony_ciif get_option('backend').startswith('vs') 78bf215546Sopenharmony_ci idep_vulkan_wsi = declare_dependency( 79bf215546Sopenharmony_ci link_with : libvulkan_wsi, 80bf215546Sopenharmony_ci dependencies : idep_vulkan_wsi_headers 81bf215546Sopenharmony_ci ) 82bf215546Sopenharmony_cielse 83bf215546Sopenharmony_ci idep_vulkan_wsi = declare_dependency( 84bf215546Sopenharmony_ci # Instruct users of this library to link with --whole-archive. Otherwise, 85bf215546Sopenharmony_ci # our weak function overloads may not resolve properly. 86bf215546Sopenharmony_ci link_whole : libvulkan_wsi, 87bf215546Sopenharmony_ci dependencies : [ 88bf215546Sopenharmony_ci idep_vulkan_wsi_headers, dep_libudev 89bf215546Sopenharmony_ci ] 90bf215546Sopenharmony_ci ) 91bf215546Sopenharmony_ciendif 92