[gtksourceview/meson-0.60-deps: 3/3] build: Look for Vulkan




commit 7af2d92ece1dc15eff5b3685df269aad009eb39d
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Jun 27 18:22:01 2022 +0800

    build: Look for Vulkan
    
    ...and include it in core_deps if it was not found via pkg-config.  The reason
    for this update is because we have no way to find out from the Gtk4 dependency
    whether Vulkan is enabled for Gtk4, and so neglect to include the header dir
    from the Vulkan SDK, which will break the build, unless Vulkan was found via
    pkg-config when building Gtk4.
    
    If Vulkan was found in ways other than pkg-config, include it as a dependency
    of core_deps so that the build can find its headers.

 gtksourceview/meson.build | 8 ++++++++
 meson.build               | 2 ++
 2 files changed, 10 insertions(+)
---
diff --git a/gtksourceview/meson.build b/gtksourceview/meson.build
index ca204a7f..279d1099 100644
--- a/gtksourceview/meson.build
+++ b/gtksourceview/meson.build
@@ -158,6 +158,14 @@ core_deps = [
   pcre2_dep,
 ]
 
+# We have no way to know from the gtk4_dep whether Vulkan support
+# is enabled, and so neglect to include the Vulkan header include
+# path unless Vulkan was found via pkg-config when gtk4 was built.
+# Help the build to find the Vulkan headers.
+if vulkan_dep.found() and vulkan_dep.type_name() != 'pkgconfig'
+  core_deps += vulkan_dep
+endif
+
 if profiler_enabled
   core_deps += [libsysprof_capture_dep]
 endif
diff --git a/meson.build b/meson.build
index 9054a4d3..59a837be 100644
--- a/meson.build
+++ b/meson.build
@@ -95,6 +95,8 @@ pcre2_dep = dependency('libpcre2-8', version: pcre2_req,
 
 gtk_quartz_dep = dependency('gtk4-quartz', version: gtk_req, required: false)
 
+vulkan_dep = dependency('vulkan', required: false)
+
 if generate_gir
   introspection_dep = dependency('gobject-introspection-1.0', version: introspection_req)
 else


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