• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
21files_vulkan_wsi = files('wsi_common.c')
22links_vulkan_wsi = []
23platform_deps = []
24
25if dep_libdrm.found()
26  files_vulkan_wsi += files('wsi_common_drm.c')
27endif
28
29if with_platform_x11
30  files_vulkan_wsi += files('wsi_common_x11.c')
31endif
32
33if with_platform_wayland
34  files_vulkan_wsi += files('wsi_common_wayland.c')
35  files_vulkan_wsi += wp_files['linux-dmabuf-unstable-v1']
36  files_vulkan_wsi += wp_files['presentation-time']
37  files_vulkan_wsi += wp_files['tearing-control-v1']
38  links_vulkan_wsi += libloader_wayland_helper
39endif
40
41if with_platform_windows
42  files_vulkan_wsi += files('wsi_common_win32.cpp')
43  platform_deps += dep_dxheaders
44else
45  files_vulkan_wsi += files('wsi_common_headless.c')
46endif
47
48if system_has_kms_drm and not with_platform_android
49  files_vulkan_wsi += files('wsi_common_display.c')
50endif
51
52wsi_entrypoints = custom_target(
53  'wsi_entrypoints',
54  input : [vk_entrypoints_gen, vk_api_xml],
55  output : ['wsi_common_entrypoints.h', 'wsi_common_entrypoints.c'],
56  command : [
57    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
58    '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'wsi',
59    '--beta', with_vulkan_beta.to_string()
60  ],
61  depend_files : vk_entrypoints_gen_depend_files,
62)
63
64libvulkan_wsi = static_library(
65  'vulkan_wsi',
66  [files_vulkan_wsi, wsi_entrypoints],
67  include_directories : [inc_include, inc_src],
68  dependencies : [
69    vulkan_wsi_deps, dep_libdrm, dep_libudev, idep_vulkan_util_headers,
70    idep_vulkan_runtime_headers, idep_xmlconfig, idep_mesautil, platform_deps,
71    idep_blake3
72  ],
73  link_with: links_vulkan_wsi,
74  gnu_symbol_visibility : 'hidden',
75  build_by_default : false,
76)
77
78idep_vulkan_wsi_headers = declare_dependency(
79  dependencies : idep_vulkan_wsi_defines,
80  include_directories : include_directories('.')
81)
82
83idep_vulkan_wsi_entrypoints_h = declare_dependency(
84  sources : [wsi_entrypoints[0]]
85)
86
87# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.
88# See this discussion here:
89# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506
90if get_option('backend').startswith('vs')
91  idep_vulkan_wsi = declare_dependency(
92    link_with : libvulkan_wsi,
93    dependencies : idep_vulkan_wsi_headers
94  )
95else
96  idep_vulkan_wsi = declare_dependency(
97    # Instruct users of this library to link with --whole-archive.  Otherwise,
98    # our weak function overloads may not resolve properly.
99    link_whole : libvulkan_wsi,
100    dependencies : [
101      idep_vulkan_wsi_headers, dep_libudev
102    ]
103  )
104endif
105