Add implementation for libresoc_CreatePipelineCache().
[mesa.git] / src / libre-soc / vulkan / meson.build
1 # Copyright © 2017 Intel Corporation
2
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
9
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
12
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 # SOFTWARE.
20
21 libresoc_extensions_h = custom_target(
22 'libresoc_extensions.h',
23 input : ['libresoc_extensions_gen.py', vk_api_xml],
24 output : 'libresoc_extensions.h',
25 command : [
26 prog_python, '@INPUT0@', '--xml', '@INPUT1@',
27 '--out-h', '@OUTPUT@',
28 ],
29 depend_files : files('libresoc_extensions.py'),
30 )
31
32 libresoc_extensions_c = custom_target(
33 'libresoc_extensions.c',
34 input : ['libresoc_extensions_gen.py', vk_api_xml],
35 output : 'libresoc_extensions.c',
36 command : [
37 prog_python, '@INPUT0@', '--xml', '@INPUT1@',
38 '--out-c', '@OUTPUT@',
39 ],
40 depend_files : files('libresoc_extensions.py'),
41 )
42
43
44 libresoc_entrypoints = custom_target(
45 'libresoc_entrypoints.[ch]',
46 input : ['libresoc_entrypoints_gen.py', vk_api_xml],
47 output : ['libresoc_entrypoints.h', 'libresoc_entrypoints.c'],
48 command : [
49 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--outdir',
50 meson.current_build_dir()
51 ],
52 depend_files : files('libresoc_extensions.py'),
53 )
54 #libresoc_entrypoints = custom_target(
55 # 'libresoc_entrypoints.[ch]',
56 # input : ['libresoc_entrypoints_gen.py', vk_api_xml],
57 # output : ['libresoc_entrypoints.h', 'libresoc_entrypoints.c'],
58 # command : [
59 # prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--outdir',
60 # meson.current_build_dir()
61 # ],
62 # depend_files : files('libresoc_extensions.py'),
63 #)
64 #
65 #libresoc_extensions_c = custom_target(
66 # 'libresoc_extensions.c',
67 # input : ['libresoc_extensions.py', vk_api_xml],
68 # output : ['libresoc_extensions.c', 'libresoc_extensions.h'],
69 # command : [
70 # prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--out-c', '@OUTPUT0@',
71 # '--out-h', '@OUTPUT1@'
72 # ],
73 #)
74
75 libresoc_vk_format_table_c = custom_target(
76 'libresoc_vk_format_table.c',
77 input : ['vk_format_table.py', 'vk_format_layout.csv'],
78 output : 'vk_format_table.c',
79 command : [prog_python, '@INPUT@'],
80 depend_files : files('vk_format_parse.py'),
81 capture : true,
82 )
83
84 liblibresoc_files = files(
85 'libresoc_device.c',
86 'libresoc_pipeline.c',
87 'libresoc_pipeline_cache.c',
88 'libresoc_util.c',
89 )
90
91 libresoc_deps = []
92 libresoc_flags = []
93
94 libresoc_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
95 if with_platform_x11
96 #libresoc_deps += dep_xcb_dri3
97 #libresoc_flags += [
98 # '-DVK_USE_PLATFORM_XCB_KHR',
99 # '-DVK_USE_PLATFORM_XLIB_KHR',
100 #]
101 #liblibresoc_files += files('libresoc_wsi_x11.c')
102 endif
103
104 if with_platform_wayland
105 #libresoc_deps += dep_wayland_client
106 #libresoc_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
107 #liblibresoc_files += files('libresoc_wsi_wayland.c')
108 endif
109
110 if system_has_kms_drm and not with_platform_android
111 #libresoc_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
112 #liblibresoc_files += files('libresoc_wsi_display.c')
113 endif
114
115 if with_xlib_lease
116 #libresoc_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
117 #libresoc_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
118 endif
119
120 if with_platform_android
121 #libresoc_deps += dep_android
122 #libresoc_flags += [
123 # '-DVK_USE_PLATFORM_ANDROID_KHR'
124 #]
125 endif
126
127 libvulkan_libresoc = shared_library(
128 'vulkan_libresoc',
129 [liblibresoc_files, libresoc_entrypoints, libresoc_extensions_c, libresoc_extensions_h, libresoc_vk_format_table_c, sha1_h],
130 include_directories : [
131 inc_include, inc_src, inc_mapi, inc_mesa, inc_compiler, inc_util, inc_vulkan_wsi, #inc_gallium, inc_gallium_aux, inc_amd, inc_amd_common, inc_amd_common_llvm,
132 ],
133 link_with : [
134 libvulkan_wsi, #libamd_common, libamd_common_llvm, libamdgpu_addrlib,
135 ],
136 dependencies : [idep_vulkan_util, libresoc_deps,idep_xmlconfig, dep_libdrm,
137 dep_llvm, dep_thread, dep_elf, dep_dl, dep_m,dep_valgrind, idep_mesautil, idep_nir,
138 # libresoc_deps, idep_aco, dep_libdrm_amdgpu,
139 # idep_amdgfxregs_h,
140 ],
141 c_args : [no_override_init_args, libresoc_flags],
142 cpp_args : [libresoc_flags],
143 link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],
144 gnu_symbol_visibility : 'hidden',
145 install : true,
146 )
147
148 if with_symbols_check
149 test(
150 'libresoc symbols check',
151 symbols_check,
152 args : [
153 '--lib', libvulkan_libresoc,
154 '--symbols-file', vulkan_icd_symbols,
155 '--ignore-symbol', 'ac_init_llvm_once',
156 symbols_check_args,
157 ],
158 suite : ['libresoc'],
159 )
160 endif
161
162 libresoc_icd = custom_target(
163 'libresoc_icd',
164 input : 'libresoc_icd.py',
165 output : 'libresoc_icd.@0@.json'.format(host_machine.cpu()),
166 command : [
167 prog_python, '@INPUT@',
168 '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
169 '--out', '@OUTPUT@',
170 ],
171 depend_files : files('libresoc_extensions.py'),
172 build_by_default : true,
173 install_dir : with_vulkan_icd_dir,
174 install : true,
175 )