Making SWAPChain exntesions work.
[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
55 libresoc_vk_format_table_c = custom_target(
56 'libresoc_vk_format_table.c',
57 input : ['vk_format_table.py', 'vk_format_layout.csv'],
58 output : 'vk_format_table.c',
59 command : [prog_python, '@INPUT@'],
60 depend_files : files('vk_format_parse.py'),
61 capture : true,
62 )
63
64 liblibresoc_files = files(
65 'libresoc_device.c',
66 'libresoc_meta_clear.c',
67 'libresoc_image.c',
68 'libresoc_cmd_buffer.c',
69 'libresoc_formats.c',
70 'libresoc_pipeline.c',
71 'libresoc_pipeline_cache.c',
72 'libresoc_util.c',
73 'libresoc_wsi.c',
74 'libresoc_private.h',
75 'vk_format.h',
76 )
77
78 libresoc_deps = []
79 libresoc_flags = []
80 libresoc_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
81 libresoc_flags += '-DVK_USE_PLATFORM_XLIB_KHR'
82 libresoc_flags += '-DVK_USE_PLATFORM_XCB_KHR'
83 if with_platform_x11
84 libresoc_deps += dep_xcb_dri3
85 libresoc_flags += [
86 '-DVK_USE_PLATFORM_XCB_KHR',
87 '-DVK_USE_PLATFORM_XLIB_KHR',
88 ]
89 liblibresoc_files += files('libresoc_wsi_x11.c')
90 endif
91
92 libvulkan_libresoc = shared_library(
93 'vulkan_libresoc',
94 [liblibresoc_files, libresoc_entrypoints, libresoc_extensions_c, libresoc_extensions_h, libresoc_vk_format_table_c, sha1_h],
95 include_directories : [
96 inc_include, inc_src, inc_mapi, inc_mesa, inc_compiler, inc_util, inc_vulkan_wsi, inc_gallium_aux, inc_gallium, #inc_amd, inc_amd_common, inc_amd_common_llvm,
97 ],
98 link_with : [
99 libvulkan_wsi, #libamd_common, libamd_common_llvm, libamdgpu_addrlib,
100 ],
101 dependencies : [idep_vulkan_util, libresoc_deps,idep_xmlconfig, dep_libdrm,
102 dep_llvm, dep_thread, dep_elf, dep_dl, dep_m,dep_valgrind, idep_mesautil, idep_nir,
103 libresoc_deps, #idep_aco, dep_libdrm_amdgpu,
104 # idep_amdgfxregs_h,
105 ],
106 c_args : [no_override_init_args, libresoc_flags],
107 cpp_args : [libresoc_flags],
108 link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],
109 gnu_symbol_visibility : 'hidden',
110 install : true,
111 )
112
113 if with_symbols_check
114 test(
115 'libresoc symbols check',
116 symbols_check,
117 args : [
118 '--lib', libvulkan_libresoc,
119 '--symbols-file', vulkan_icd_symbols,
120 '--ignore-symbol', 'ac_init_llvm_once',
121 symbols_check_args,
122 ],
123 suite : ['libresoc'],
124 )
125 endif
126
127 libresoc_icd = custom_target(
128 'libresoc_icd',
129 input : 'libresoc_icd.py',
130 output : 'libresoc_icd.@0@.json'.format(host_machine.cpu()),
131 command : [
132 prog_python, '@INPUT@',
133 '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
134 '--out', '@OUTPUT@',
135 ],
136 depend_files : files('libresoc_extensions.py'),
137 build_by_default : true,
138 install_dir : with_vulkan_icd_dir,
139 install : true,
140 )