From fe737fc2744654a1ed07bbb356628acfb1d9d335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Tue, 23 Apr 2024 21:57:57 +0200 Subject: [PATCH] vulkan: fix macos build The VulkanSDK can be downloaded from LunarG website and can be installed properly in /usr/local following: https://vulkan.lunarg.com/doc/view/latest/mac/getting_started.html Fixes partly #2372 Part-of: --- .../gst-libs/gst/vulkan/meson.build | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/meson.build b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/meson.build index d08e710cef..55571e8277 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/meson.build +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/meson.build @@ -107,13 +107,16 @@ foreach option : vulkan_conf_options endforeach if ['ios', 'darwin'].contains(host_system) - # - ios does not support the loader/validation layers - # - We need to link directly to MoltenVK to be able to use - # MoltenVK-specific functions that use dispatchable handles (like - # retrieving the metal device from the VkDevice) which is currently waiting - # on implementing a proper Metal extension for Vulkan - # https://github.com/KhronosGroup/MoltenVK/issues/492 - vulkan_dep = cc.find_library('MoltenVK', required : get_option('vulkan')) + vulkan_dep = dependency('vulkan', method: 'pkg-config', required : false) + if not vulkan_dep.found() + # - ios does not support the loader/validation layers + # - We need to link directly to MoltenVK to be able to use + # MoltenVK-specific functions that use dispatchable handles (like + # retrieving the metal device from the VkDevice) which is currently waiting + # on implementing a proper Metal extension for Vulkan + # https://github.com/KhronosGroup/MoltenVK/issues/492 + vulkan_dep = cc.find_library('MoltenVK', required : get_option('vulkan')) + endif elif host_system == 'windows' vulkan_root = run_command(python3, '-c', 'import os; print(os.environ.get("VK_SDK_PATH"))', check: false).stdout().strip() if vulkan_root != '' and vulkan_root != 'None' @@ -144,7 +147,7 @@ else endif if host_system != 'windows' - has_vulkan_header = cc.has_header('vulkan/vulkan_core.h') + has_vulkan_header = cc.has_header('vulkan/vulkan_core.h', dependencies: vulkan_dep) endif if not has_vulkan_header and get_option('vulkan').enabled()