meson: only build imgui when needed
[mesa.git] / src / vulkan / util / meson.build
index 15e4ff491293d9d1d3db15f7e92bba84cce41538..f4f7d1730e3941d20d031b97ae5a7cddd769b585 100644 (file)
@@ -22,24 +22,36 @@ files_vulkan_util = files(
   'vk_alloc.h',
   'vk_debug_report.c',
   'vk_debug_report.h',
+  'vk_format.c',
   'vk_util.c',
   'vk_util.h',
 )
 
 vk_enum_to_str = custom_target(
   'vk_enum_to_str',
-  input : ['gen_enum_to_str.py', vk_api_xml[0]],
+  input : ['gen_enum_to_str.py', vk_api_xml],
   output : ['vk_enum_to_str.c', 'vk_enum_to_str.h'],
   command : [
-    prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--outdir',
-    meson.current_build_dir()
+    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
+    '--outdir', meson.current_build_dir()
   ],
 )
 
 libvulkan_util = static_library(
   'vulkan_util',
   [files_vulkan_util, vk_enum_to_str],
-  include_directories : [inc_common, inc_vulkan],
-  c_args : [c_vis_args],
+  include_directories : inc_common,
+  dependencies : vulkan_wsi_deps,
+  c_args : [c_vis_args, vulkan_wsi_args],
   build_by_default : false,
 )
+
+idep_vulkan_util_headers = declare_dependency(
+  sources : vk_enum_to_str[1],
+  include_directories : include_directories('.')
+)
+
+idep_vulkan_util = declare_dependency(
+  link_with : libvulkan_util,
+  dependencies : idep_vulkan_util_headers
+)