Mesa (main): vulkan: use c_msvc_compat_args for shared code

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 27 12:34:04 UTC 2022


Module: Mesa
Branch: main
Commit: 6623f60c34c8c40d2624c6f10406c09504d12c0d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6623f60c34c8c40d2624c6f10406c09504d12c0d

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Tue Apr 26 12:10:35 2022 +0200

vulkan: use c_msvc_compat_args for shared code

Due to both Lavapipe on Windows and Dozen, we need to support MSVC in
the shared Vulkan code. So let's make sure we compile with the
compatibility flags for it.

Techinically speaking, we also need this in the wsi subdir, because we
also compile wsi_common_win32.c with MSVC. But wsi_common_wayland.c
contains void-pointer arithmetic, causing compiler errors if we do.

Fixing that properly is a bit more involved, because Meson doesn't love
passing different compiler arguments per source-file. The alternative is
to remove the void-pointer arithmetic, but that seems a bit pointless as
this code will never be compiled on MSVC.

So, let's leave that one out for now. We can probably do better in the
future, but this gets us a step further.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6386
Reviewed-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16162>

---

 src/vulkan/runtime/meson.build | 2 +-
 src/vulkan/util/meson.build    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/vulkan/runtime/meson.build b/src/vulkan/runtime/meson.build
index 7b01e2ccdef..820e4537315 100644
--- a/src/vulkan/runtime/meson.build
+++ b/src/vulkan/runtime/meson.build
@@ -158,7 +158,7 @@ libvulkan_runtime = static_library(
   dependencies : vulkan_runtime_deps,
   # For glsl_type_singleton
   link_with : libcompiler,
-  c_args : [vulkan_wsi_args],
+  c_args : [vulkan_wsi_args, c_msvc_compat_args],
   gnu_symbol_visibility : 'hidden',
   build_by_default : false,
 )
diff --git a/src/vulkan/util/meson.build b/src/vulkan/util/meson.build
index 9d36965a1d0..ecd4ea448f0 100644
--- a/src/vulkan/util/meson.build
+++ b/src/vulkan/util/meson.build
@@ -98,7 +98,7 @@ libvulkan_util = static_library(
   [files_vulkan_util, vk_dispatch_table, vk_enum_to_str, vk_extensions],
   include_directories : [inc_include, inc_src, inc_gallium],
   dependencies : [vulkan_wsi_deps, idep_mesautil, idep_nir_headers],
-  c_args : [vulkan_wsi_args],
+  c_args : [vulkan_wsi_args, c_msvc_compat_args],
   gnu_symbol_visibility : 'hidden',
   build_by_default : false,
 )



More information about the mesa-commit mailing list