meson: Find MoltenVK with the objc++ compiler everywhere

When building for iOS in Cerbero, as of MoltenVK SDK 1.3.283, we have
to statically link to libMoltenVK since it no longer ships a dylib.
This requires linking to libc++, so we find the dep with the objc++
compiler to ensure that meson uses the right linker.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7091>
This commit is contained in:
Nirbheek Chauhan 2024-06-23 04:27:42 +05:30
parent adedac6bd9
commit 156a016313
2 changed files with 4 additions and 3 deletions

View file

@ -117,7 +117,8 @@ if ['ios', 'darwin'].contains(host_system)
# 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 : vulkan_opt)
objcpp = meson.get_compiler('objcpp')
vulkan_dep = objcpp.find_library('MoltenVK', required : vulkan_opt)
endif
elif host_system == 'windows'
vulkan_root = run_command(python3, '-c', 'import os; print(os.environ.get("VK_SDK_PATH"))', check: false).stdout().strip()

View file

@ -91,9 +91,9 @@ applemedia_objcpp_args = []
vulkan_option = get_option('vulkan')
vk_required = applemedia_option.enabled() and vulkan_option.enabled()
if gstvulkan_dep.found() and have_objcpp and not vulkan_option.disabled()
moltenvk_dep = cc.find_library('MoltenVK', required: vk_required)
moltenvk_dep = objcpp.find_library('MoltenVK', required: vk_required)
metal_dep = dependency('appleframeworks', modules : ['Metal'], required: vk_required)
have_mvk_header = cc.has_header('MoltenVK/vk_mvk_moltenvk.h', required: vk_required)
have_mvk_header = objcpp.has_header('MoltenVK/vk_mvk_moltenvk.h', required: vk_required)
if metal_dep.found() and moltenvk_dep.found() and have_mvk_header
applemedia_frameworks += [moltenvk_dep, gstvulkan_dep, metal_dep]
applemedia_sources += [