-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
119 lines (103 loc) · 2.89 KB
/
meson.build
File metadata and controls
119 lines (103 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
project('eedi3vk', 'cpp',
version : '1.3',
license : 'GPL-3.0-or-later',
default_options : [
'cpp_std=c++23',
'warning_level=3',
'buildtype=release'
]
)
cxx = meson.get_compiler('cpp')
buildtype = get_option('buildtype')
if buildtype != 'debug' and buildtype != 'debugoptimized'
add_project_link_arguments('-flto', language: ['cpp'])
add_project_arguments('-flto', language: ['cpp'])
endif
vapoursynth_dep = dependency('vapoursynth', version: '>=55')
vulkan_headers_dep = dependency(
'vulkan-headers',
fallback: ['vulkan-headers', 'vulkan_headers_dep'],
required: false,
)
# Some distros don't ship a standalone `vulkan-headers.pc`.
# Try the system Vulkan SDK's aggregate dependency instead.
if not vulkan_headers_dep.found()
vulkan_dep = dependency('vulkan', required: false)
if vulkan_dep.found()
vulkan_headers_dep = vulkan_dep.partial_dependency(
includes: true,
compile_args: true
)
else
vulkan_headers_dep = dependency(
'vulkan-headers',
fallback: ['vulkan-headers', 'vulkan_headers_dep']
)
endif
endif
volk_dep = dependency('volk',
fallback: ['volk', 'volk_dep']
)
vma_dep = dependency(
'vulkan_memory_allocator',
fallback: ['vulkan-memory-allocator', 'vma_dep'],
required: false,
)
if not vma_dep.found()
if cxx.has_header('vk_mem_alloc.h')
vma_dep = declare_dependency()
else
error('vk_mem_alloc.h not found (need vulkan-memory-allocator or the subproject).')
endif
endif
dependencies = [
vapoursynth_dep,
vulkan_headers_dep,
volk_dep,
vma_dep
]
install_dir = vapoursynth_dep.get_variable(pkgconfig: 'libdir') / 'vapoursynth'
sources = [
'src/eedi3vk.cpp',
'src/vulkan/VulkanContext.cpp',
'src/vulkan/VulkanMemory.cpp',
'src/vulkan/VulkanComputePipeline.cpp',
'src/vulkan/VulkanResourcePool.cpp',
'src/vulkan/EEDI3Pipelines.cpp',
]
glslc = find_program('glslc', required: true)
shader_files = [
'src/shaders/copy_field.comp',
'src/shaders/dilate_mask.comp',
'src/shaders/calc_costs.comp',
'src/shaders/viterbi_scan.comp',
'src/shaders/interpolate.comp',
'src/shaders/copy_buffer.comp',
]
spirv_outputs = []
foreach shader : shader_files
shader_name = shader.split('/')[-1].split('.')[0]
spirv_target = custom_target(shader_name + '_spv',
input: shader,
output: shader_name + '.spv',
command: [glslc, '--target-env=vulkan1.1', '-O', '@INPUT@', '-o', '@OUTPUT@'],
build_by_default: true
)
spirv_outputs += spirv_target
endforeach
spirv_include = include_directories('.')
eedi3vk_module = shared_module('eedi3vk', sources,
dependencies: dependencies,
include_directories: spirv_include,
link_depends: spirv_outputs,
install: true,
install_dir: install_dir
)
if host_machine.system() == 'darwin'
custom_target('eedi3vk_dsym',
input: eedi3vk_module,
output: 'libeedi3vk.dylib.dSYM',
command: ['dsymutil', '@INPUT@'],
build_by_default: true
)
endif