[gtkmm/fix-vulkan-builds] meson.build: Fix builds with Vulkan-enabled GTK




commit 1b5149eab06ff6c89b3d03b5da7d8065efe488c5
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon May 23 10:39:30 2022 +0800

    meson.build: Fix builds with Vulkan-enabled GTK
    
    Look for the Vulkan SDK so that we can find its headers, which is needed
    when compiling the sources against a GTK-4.x build that has the Vulkan GSK
    renderer enabled for the build.  We do not link to the Vulkan libraries to
    build gtkmm, so for now we do not add a dependency in gtkmm's pkg-config files,
    and Meson may have found Vulkan internally via methods other than pkg-config.

 meson.build | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 3f4973d3..d52ef499 100644
--- a/meson.build
+++ b/meson.build
@@ -121,6 +121,12 @@ gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req)
 epoxy_req = '>= 1.2'
 epoxy_dep = dependency('epoxy', version: epoxy_req, required: build_demos)
 
+# Vulkan (optional, but needed here if GTK was built with Vulkan support for its headers)
+# Uses meson's custom vulkan dependency searching. Set the VULKAN_SDK env var
+# to use a custom path for the Vulkan SDK. Bugs that are found with it should
+# be reported upstream and fixed.
+vulkan_dep = dependency('vulkan', required: false)
+
 # The -mm libraries do not yet have pkg-config files for MSVC builds,
 # so check for them manually
 glibmm_req_minor_ver = '68'
@@ -133,7 +139,7 @@ gmmproc_dir = glibmm_dep.get_variable(pkgconfig: 'gmmprocdir', internal: 'gmmpro
 
 gmmproc_extra_m4_dirs = [pangomm_dep.get_variable(pkgconfig: 'gmmprocm4dir', internal: 'gmmprocm4dir')]
 
-gdkmm_build_dep = [giomm_dep, gtk_dep, cairomm_dep, pangomm_dep, gdk_pixbuf_dep]
+gdkmm_build_dep = [giomm_dep, gtk_dep, cairomm_dep, pangomm_dep, gdk_pixbuf_dep, vulkan_dep]
 gdkmm_requires = [
   'giomm-2.@0@'.format(glibmm_req_minor_ver), glibmm_req,
   'gtk4', gtk_req,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]