Skip to content

Commit

Permalink
meson: Check for bundled Vulkan/SPIR-V headers before adding them to …
Browse files Browse the repository at this point in the history
…the include list.

This feature requires Meson 0.58 or newer.
  • Loading branch information
flibitijibibo authored and doitsujin committed Mar 6, 2024
1 parent 0414bbe commit 4b0e311
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
project('dxvk', ['c', 'cpp'], version : 'v2.3', meson_version : '>= 0.49', default_options : [ 'cpp_std=c++17', 'warning_level=2' ])
project('dxvk', ['c', 'cpp'], version : 'v2.3', meson_version : '>= 0.58', default_options : [ 'cpp_std=c++17', 'warning_level=2' ])

cpu_family = target_machine.cpu_family()
platform = target_machine.system()
fs = import('fs')

cpp = meson.get_compiler('cpp')
cc = meson.get_compiler('c')
Expand Down Expand Up @@ -33,11 +34,17 @@ if get_option('build_id')
]
endif

dxvk_include_dirs = [
'./include',
'./include/vulkan/include',
'./include/spirv/include'
]
dxvk_include_dirs = ['./include']
if fs.is_dir('./include/vulkan/include')
dxvk_include_dirs += ['./include/vulkan/include']
elif not cpp.check_header('vulkan/vulkan.h')
error('Missing Vulkan-Headers')
endif
if fs.is_dir('./include/spirv/include')
dxvk_include_dirs += ['./include/spirv/include']
elif not cpp.check_header('spirv/unified1/spirv.hpp')
error('Missing SPIRV-Headers')
endif

dep_displayinfo = dependency(
'libdisplay-info',
Expand Down

0 comments on commit 4b0e311

Please sign in to comment.