meson/vulkan: fix linkage on windows

The current approach likley breaks icl and clang-cl, but it seems that
the problem isn't even really related to MSVC, but to Meson's Visual
Studio backend, as such, let's use link-whole unless we're using a
Visual Studio backend.

Fixes: 48d31a6280
       ("meson: link vulkan_util with link_whole on mingw")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: James Park <jpark37@lagfreegames.com>
(cherry picked from commit f03da01fe3)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10379>
This commit is contained in:
Dylan Baker 2021-04-28 16:14:58 -07:00 committed by Eric Engestrom
parent c51a8d1273
commit f08e0a2016
2 changed files with 5 additions and 2 deletions

View file

@ -1957,7 +1957,7 @@
"description": "meson/vulkan: fix linkage on windows",
"nominated": false,
"nomination_type": 1,
"resolution": 4,
"resolution": 1,
"master_sha": null,
"because_sha": "48d31a6280c4de07279435606a5c0524c1787cad"
},

View file

@ -125,7 +125,10 @@ idep_vulkan_util_headers = declare_dependency(
include_directories : include_directories('.')
)
if cc.get_id() == 'msvc'
# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.
# See this discussion here:
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506
if get_option('backend').startswith('vs')
idep_vulkan_util = declare_dependency(
link_with : libvulkan_util,
dependencies : idep_vulkan_util_headers