[gtk+] meson.build: Fix Vulkan library detection on Visual Studio



commit 0b783f67500f4ebcf77524b6fade868910f53eec
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Aug 11 17:05:55 2017 +0800

    meson.build: Fix Vulkan library detection on Visual Studio
    
    The Vulkan .lib file that is supplied by the LunarG Vulkan SDK is
    vulkan-1.lib, not vulkan.lib, so make sure we look for the right
    libraries when building on Visual Studio (I am not sure whether the
    LunarG SDK will work for MinGW/mingw-w64 builds, as only Visual Studio
    .lib files are provided).
    
    Note that this will require one to set LIB and INCLUDE appropriately to
    find the Vulkan .lib and header files, and possibly PATH if one's video
    drivers do not contain the Vulkan runtime DLL.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785210

 meson.build |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 6d849b9..7bc8912 100644
--- a/meson.build
+++ b/meson.build
@@ -508,12 +508,19 @@ cdata.set('HAVE_GIO_UNIX', giounix_dep.found())
 # TODO: move to gsk subfolder maybe? Or will it be used elsewhere too?
 have_vulkan = false
 vulkan_lib = []
+
+if cc.get_id() == 'msvc'
+  vulkan_libname = 'vulkan-1'
+else
+  vulkan_libname = 'vulkan'
+endif
+
 enable_vulkan = get_option('enable-vulkan')
 if enable_vulkan != 'no'
-  vulkan_lib = cc.find_library('vulkan', required: false)
+  vulkan_lib = cc.find_library(vulkan_libname, required: false)
   if vulkan_lib.found() and cc.has_function('vkCreateInstance', dependencies: vulkan_lib) and 
cc.has_header('vulkan/vulkan.h')
     have_vulkan = true
-    pc_gdk_extra_libs += ['-lvulkan']
+    pc_gdk_extra_libs += ['-l@0@'.format(vulkan_libname)]
   elif enable_vulkan == 'yes'
     error('Vulkan support not found, but was explicitly requested.')
   endif


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