18a1362adSmaya# Copyright © 2019 Intel Corporation
28a1362adSmaya
38a1362adSmaya# Permission is hereby granted, free of charge, to any person obtaining a copy
48a1362adSmaya# of this software and associated documentation files (the "Software"), to deal
58a1362adSmaya# in the Software without restriction, including without limitation the rights
68a1362adSmaya# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
78a1362adSmaya# copies of the Software, and to permit persons to whom the Software is
88a1362adSmaya# furnished to do so, subject to the following conditions:
98a1362adSmaya
108a1362adSmaya# The above copyright notice and this permission notice shall be included in
118a1362adSmaya# all copies or substantial portions of the Software.
128a1362adSmaya
138a1362adSmaya# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
148a1362adSmaya# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
158a1362adSmaya# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
168a1362adSmaya# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
178a1362adSmaya# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
188a1362adSmaya# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
198a1362adSmaya# SOFTWARE.
208a1362adSmaya
218a1362adSmayaoverlay_shaders = [
228a1362adSmaya  'overlay.frag',
238a1362adSmaya  'overlay.vert',
248a1362adSmaya]
258a1362adSmayaoverlay_spv = []
268a1362adSmayaforeach s : ['overlay.frag', 'overlay.vert']
278a1362adSmaya  overlay_spv += custom_target(
288a1362adSmaya    s + '.spv.h', input : s, output : s + '.spv.h',
297ec681f3Smrg    command : [prog_glslang, '-V', '-x', '-o', '@OUTPUT@', '@INPUT@'])
308a1362adSmayaendforeach
318a1362adSmaya
328a1362adSmayavklayer_files = files(
338a1362adSmaya  'overlay.cpp',
348a1362adSmaya  'overlay_params.c',
358a1362adSmaya)
368a1362adSmaya
378a1362adSmayavklayer_mesa_overlay = shared_library(
388a1362adSmaya  'VkLayer_MESA_overlay',
397ec681f3Smrg  vklayer_files, overlay_spv, sha1_h,
407ec681f3Smrg  c_args : [no_override_init_args, vulkan_wsi_args],
417ec681f3Smrg  cpp_args : [vulkan_wsi_args],
427ec681f3Smrg  gnu_symbol_visibility : 'hidden',
437ec681f3Smrg  dependencies : [idep_vulkan_util, idep_mesautil, vulkan_wsi_deps, libimgui_core_dep, dep_dl],
447ec681f3Smrg  include_directories : [inc_include, inc_src],
458a1362adSmaya  link_args : cc.get_supported_link_arguments(['-Wl,-Bsymbolic-functions', '-Wl,-z,relro']),
468a1362adSmaya  install : true
478a1362adSmaya)
488a1362adSmaya
498a1362adSmayainstall_data(
508a1362adSmaya  files('VkLayer_MESA_overlay.json'),
518a1362adSmaya  install_dir : join_paths(get_option('datadir'), 'vulkan', 'explicit_layer.d'),
528a1362adSmaya)
537ec681f3Smrg
547ec681f3Smrginstall_data(
557ec681f3Smrg  'mesa-overlay-control.py',
567ec681f3Smrg  install_dir : get_option('bindir'),
577ec681f3Smrg  install_mode : 'r-xr-xr-x',
587ec681f3Smrg)
59