zink/apple: added moltenvk-dir search to allow MoltenVK to be sourced from brew.

The file layout in the brew obtained molten-vk package is differnt again to the VulkanSDK or MoltenVK packages.
Added an extra sub-directory location search from the `moltenvk-dir` build option.

This allows for the following to be used `-Dmoltenvk-dir=$(brew --prefix molten-vk)`.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28330>
This commit is contained in:
duncan.hopkins 2024-03-22 10:56:16 +00:00 committed by Marge Bot
parent 5532f13566
commit f75750f740

View file

@ -82,11 +82,17 @@ if host_machine.system() == 'darwin'
# MoltenVK options
if with_moltenvk_dir != ''
fs = import('fs')
# Vulkan SDK 1.3.250 to 1.3.268 support
moltenvk_includes = join_paths(with_moltenvk_dir, 'MoltenVK', 'include')
if not fs.is_dir(moltenvk_includes)
# Vulkan SDK 1.3.275 onwards support
moltenvk_includes = join_paths(with_moltenvk_dir, 'macos', 'include')
if not fs.is_dir(moltenvk_includes)
error(f'moltenvk includes cannot be found in moltenvk-dir="@with_moltenvk_dir@"')
# MoltenVK from brew support
moltenvk_includes = join_paths(with_moltenvk_dir, 'include')
if not fs.is_dir(moltenvk_includes)
error(f'moltenvk includes cannot be found in moltenvk-dir="@with_moltenvk_dir@"')
endif
endif
endif
inc_zink_vk += include_directories(moltenvk_includes)