LibreSoc Vulkan Driver Initial Commit
[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_util.c',
88 )
89
90 libresoc_deps = []
91 libresoc_flags = []
92
93 libresoc_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
94 if with_platform_x11
95 #libresoc_deps += dep_xcb_dri3
96 #libresoc_flags += [
97 # '-DVK_USE_PLATFORM_XCB_KHR',
98 # '-DVK_USE_PLATFORM_XLIB_KHR',
99 #]
100 #liblibresoc_files += files('libresoc_wsi_x11.c')
101 endif
102
103 if with_platform_wayland
104 #libresoc_deps += dep_wayland_client
105 #libresoc_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
106 #liblibresoc_files += files('libresoc_wsi_wayland.c')
107 endif
108
109 if system_has_kms_drm and not with_platform_android
110 #libresoc_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
111 #liblibresoc_files += files('libresoc_wsi_display.c')
112 endif
113
114 if with_xlib_lease
115 #libresoc_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
116 #libresoc_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
117 endif
118
119 if with_platform_android
120 #libresoc_deps += dep_android
121 #libresoc_flags += [
122 # '-DVK_USE_PLATFORM_ANDROID_KHR'
123 #]
124 endif
125
126 libvulkan_libresoc = shared_library(
127 'vulkan_libresoc',
128 [liblibresoc_files, libresoc_entrypoints, libresoc_extensions_c, libresoc_extensions_h, libresoc_vk_format_table_c, sha1_h],
129 include_directories : [
130 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,
131 ],
132 link_with : [
133 libvulkan_wsi, #libamd_common, libamd_common_llvm, libamdgpu_addrlib,
134 ],
135 dependencies : [idep_vulkan_util, libresoc_deps,idep_xmlconfig, dep_libdrm,
136 dep_llvm, dep_thread, dep_elf, dep_dl, dep_m,dep_valgrind, idep_mesautil, idep_nir,
137 # libresoc_deps, idep_aco, dep_libdrm_amdgpu,
138 # idep_amdgfxregs_h,
139 ],
140 c_args : [no_override_init_args, libresoc_flags],
141 cpp_args : [libresoc_flags],
142 link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],
143 gnu_symbol_visibility : 'hidden',
144 install : true,
145 )
146
147 if with_symbols_check
148 test(
149 'libresoc symbols check',
150 symbols_check,
151 args : [
152 '--lib', libvulkan_libresoc,
153 '--symbols-file', vulkan_icd_symbols,
154 '--ignore-symbol', 'ac_init_llvm_once',
155 symbols_check_args,
156 ],
157 suite : ['libresoc'],
158 )
159 endif
160
161 libresoc_icd = custom_target(
162 'libresoc_icd',
163 input : 'libresoc_icd.py',
164 output : 'libresoc_icd.@0@.json'.format(host_machine.cpu()),
165 command : [
166 prog_python, '@INPUT@',
167 '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
168 '--out', '@OUTPUT@',
169 ],
170 depend_files : files('libresoc_extensions.py'),
171 build_by_default : true,
172 install_dir : with_vulkan_icd_dir,
173 install : true,
174 )