At this stage after adding few more stubs driver fails at
[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_descriptor_set.c',
67 'libresoc_pass.c',
68 'libresoc_meta_clear.c',
69 'libresoc_image.c',
70 'libresoc_cmd_buffer.c',
71 'libresoc_formats.c',
72 'libresoc_pipeline.c',
73 'libresoc_pipeline_cache.c',
74 'libresoc_util.c',
75 'libresoc_wsi.c',
76 'libresoc_private.h',
77 'vk_format.h',
78 )
79
80 libresoc_deps = []
81 libresoc_flags = []
82 libresoc_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
83 libresoc_flags += '-DVK_USE_PLATFORM_XLIB_KHR'
84 libresoc_flags += '-DVK_USE_PLATFORM_XCB_KHR'
85 if with_platform_x11
86 libresoc_deps += dep_xcb_dri3
87 libresoc_flags += [
88 '-DVK_USE_PLATFORM_XCB_KHR',
89 '-DVK_USE_PLATFORM_XLIB_KHR',
90 ]
91 liblibresoc_files += files('libresoc_wsi_x11.c')
92 endif
93
94 libvulkan_libresoc = shared_library(
95 'vulkan_libresoc',
96 [liblibresoc_files, libresoc_entrypoints, libresoc_extensions_c, libresoc_extensions_h, libresoc_vk_format_table_c, sha1_h],
97 include_directories : [
98 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,
99 ],
100 link_with : [
101 libvulkan_wsi, #libamd_common, libamd_common_llvm, libamdgpu_addrlib,
102 ],
103 dependencies : [idep_vulkan_util, libresoc_deps,idep_xmlconfig, dep_libdrm,
104 dep_llvm, dep_thread, dep_elf, dep_dl, dep_m,dep_valgrind, idep_mesautil, idep_nir,
105 libresoc_deps, #idep_aco, dep_libdrm_amdgpu,
106 # idep_amdgfxregs_h,
107 ],
108 c_args : [no_override_init_args, libresoc_flags],
109 cpp_args : [libresoc_flags],
110 link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],
111 gnu_symbol_visibility : 'hidden',
112 install : true,
113 )
114
115 if with_symbols_check
116 test(
117 'libresoc symbols check',
118 symbols_check,
119 args : [
120 '--lib', libvulkan_libresoc,
121 '--symbols-file', vulkan_icd_symbols,
122 '--ignore-symbol', 'ac_init_llvm_once',
123 symbols_check_args,
124 ],
125 suite : ['libresoc'],
126 )
127 endif
128
129 libresoc_icd = custom_target(
130 'libresoc_icd',
131 input : 'libresoc_icd.py',
132 output : 'libresoc_icd.@0@.json'.format(host_machine.cpu()),
133 command : [
134 prog_python, '@INPUT@',
135 '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
136 '--out', '@OUTPUT@',
137 ],
138 depend_files : files('libresoc_extensions.py'),
139 build_by_default : true,
140 install_dir : with_vulkan_icd_dir,
141 install : true,
142 )