[gtk: 1/2] meson: Fix Vulkan dependency checking




commit b25871438d9b112ee7a70b8d6880c0e200f57cfe
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Fri Sep 4 11:32:35 2020 +0530

    meson: Fix Vulkan dependency checking
    
    The dependency block was completely wrong. It was:
    
    1. Not searching for the lib manually when -Dvulkan=enabled (default).
       The else block was only hit when -Dvulkan=auto.
    2. Unconditionally searching for the vulkan library in the else block
       when -Dvulkan=disabled
    
    The manual searching is also not required because Meson has a custom
    'vulkan' dependency class that already supports Windows, and is more
    correct than the code here. Specifically, the current code does not
    support picking up the Vulkan SDK from a custom path.
    
    Fixes #3108

 meson.build | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/meson.build b/meson.build
index 5ad8508fb3..c520298a84 100644
--- a/meson.build
+++ b/meson.build
@@ -648,23 +648,16 @@ if os_unix
 endif
 
 # Check for Vulkan support
+# 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: get_option('vulkan'))
 if vulkan_dep.found()
   have_vulkan = true
-  vulkan_pkg_found = true
+  vulkan_pkg_found = vulkan_dep.type_name() == 'pkgconfig'
 else
   have_vulkan = false
   vulkan_pkg_found = false
-  if cc.get_id() == 'msvc'
-    vulkan_libname = 'vulkan-1'
-  else
-    vulkan_libname = 'vulkan'
-  endif
-  vulkan_dep = cc.find_library(vulkan_libname, required: false)
-  if vulkan_dep.found() and cc.has_function('vkCreateInstance', dependencies: vulkan_dep) and 
cc.has_header('vulkan/vulkan.h')
-    have_vulkan = true
-    pc_gdk_extra_libs += ['-l@0@'.format(vulkan_libname)]
-  endif
 endif
 
 cloudproviders_dep = dependency('cloudproviders',


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