meson.build revision 01e04c3f
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
21gl_and_es_api_files = files('gl_and_es_API.xml')
22
23api_xml_files = files(
24  'gl_API.xml',
25  'es_EXT.xml',
26  'gl_and_es_API.xml',
27  'gl_and_glX_API.xml',
28  'ARB_base_instance.xml',
29  'ARB_blend_func_extended.xml',
30  'ARB_bindless_texture.xml',
31  'ARB_clear_buffer_object.xml',
32  'ARB_clear_texture.xml',
33  'ARB_clip_control.xml',
34  'ARB_color_buffer_float.xml',
35  'ARB_compressed_texture_pixel_storage.xml',
36  'ARB_compute_shader.xml',
37  'ARB_compute_variable_group_size.xml',
38  'ARB_copy_buffer.xml',
39  'ARB_copy_image.xml',
40  'ARB_debug_output.xml',
41  'ARB_depth_buffer_float.xml',
42  'ARB_depth_clamp.xml',
43  'ARB_direct_state_access.xml',
44  'ARB_draw_buffers.xml',
45  'ARB_draw_buffers_blend.xml',
46  'ARB_draw_elements_base_vertex.xml',
47  'ARB_draw_indirect.xml',
48  'ARB_draw_instanced.xml',
49  'ARB_ES2_compatibility.xml',
50  'ARB_ES3_compatibility.xml',
51  'ARB_framebuffer_no_attachments.xml',
52  'ARB_framebuffer_object.xml',
53  'ARB_get_program_binary.xml',
54  'ARB_get_texture_sub_image.xml',
55  'ARB_gl_spirv.xml',
56  'ARB_gpu_shader_fp64.xml',
57  'ARB_gpu_shader_int64.xml',
58  'ARB_gpu_shader5.xml',
59  'ARB_indirect_parameters.xml',
60  'ARB_instanced_arrays.xml',
61  'ARB_internalformat_query.xml',
62  'ARB_internalformat_query2.xml',
63  'ARB_invalidate_subdata.xml',
64  'ARB_map_buffer_range.xml',
65  'ARB_multi_bind.xml',
66  'ARB_pipeline_statistics_query.xml',
67  'ARB_program_interface_query.xml',
68  'ARB_robustness.xml',
69  'ARB_sample_shading.xml',
70  'ARB_sampler_objects.xml',
71  'ARB_seamless_cube_map.xml',
72  'ARB_separate_shader_objects.xml',
73  'ARB_shader_atomic_counters.xml',
74  'ARB_shader_image_load_store.xml',
75  'ARB_shader_subroutine.xml',
76  'ARB_shader_storage_buffer_object.xml',
77  'ARB_sparse_buffer.xml',
78  'ARB_sync.xml',
79  'ARB_tessellation_shader.xml',
80  'ARB_texture_barrier.xml',
81  'ARB_texture_buffer_object.xml',
82  'ARB_texture_buffer_range.xml',
83  'ARB_texture_compression_rgtc.xml',
84  'ARB_texture_cube_map_array.xml',
85  'ARB_texture_float.xml',
86  'ARB_texture_gather.xml',
87  'ARB_texture_multisample.xml',
88  'ARB_texture_rgb10_a2ui.xml',
89  'ARB_texture_rg.xml',
90  'ARB_texture_storage_multisample.xml',
91  'ARB_texture_storage.xml',
92  'ARB_texture_view.xml',
93  'ARB_uniform_buffer_object.xml',
94  'ARB_vertex_array_object.xml',
95  'ARB_vertex_attrib_64bit.xml',
96  'ARB_vertex_attrib_binding.xml',
97  'ARB_viewport_array.xml',
98  'AMD_depth_clamp_separate.xml',
99  'AMD_draw_buffers_blend.xml',
100  'AMD_gpu_shader_int64.xml',
101  'AMD_performance_monitor.xml',
102  'ARB_vertex_type_2_10_10_10_rev.xml',
103  'APPLE_object_purgeable.xml',
104  'APPLE_vertex_array_object.xml',
105  'EXT_draw_buffers2.xml',
106  'EXT_external_objects.xml',
107  'EXT_external_objects_fd.xml',
108  'EXT_framebuffer_object.xml',
109  'EXT_gpu_shader4.xml',
110  'EXT_packed_depth_stencil.xml',
111  'EXT_provoking_vertex.xml',
112  'EXT_separate_shader_objects.xml',
113  'EXT_texture_array.xml',
114  'EXT_texture_integer.xml',
115  'EXT_transform_feedback.xml',
116  'EXT_vertex_attrib_64bit.xml',
117  'EXT_window_rectangles.xml',
118  'GREMEDY_string_marker.xml',
119  'INTEL_performance_query.xml',
120  'KHR_debug.xml',
121  'KHR_context_flush_control.xml',
122  'KHR_robustness.xml',
123  'KHR_robustness_es.xml',
124  'KHR_texture_compression_astc.xml',
125  'NV_conditional_render.xml',
126  'NV_primitive_restart.xml',
127  'NV_texture_barrier.xml',
128  'NV_vdpau_interop.xml',
129  'OES_EGL_image.xml',
130  'OES_fixed_point.xml',
131  'OES_single_precision.xml',
132  'OES_texture_compression_astc.xml',
133  'GL3x.xml',
134  'GL4x.xml',
135)
136
137glapi_gen_depends = files(
138  'gl_XML.py',
139  'glX_XML.py',
140  'license.py',
141  'static_data.py',
142  'typeexpr.py',
143) + api_xml_files
144
145glx_gen_depends = files(
146  'glX_API.xml',
147  'glX_XML.py',
148  'glX_proto_common.py',
149) + api_xml_files
150
151glapi_mapi_tmp_h = custom_target(
152  'glapi_mapi_tmp.h',
153  input : [mapi_abi_py, 'gl_and_es_API.xml'],
154  output : 'glapi_mapi_tmp.h',
155  command : [prog_python, '@INPUT0@', '--printer', 'glapi', '@INPUT1@'],
156  depend_files : glapi_gen_depends,
157  capture : true,
158)
159
160glprocs_h = custom_target(
161  'glprocs.h',
162  input : ['gl_procs.py', 'gl_and_es_API.xml'],
163  output : 'glprocs.h',
164  command : [prog_python, '@INPUT0@', '-c', '-f', '@INPUT1@'],
165  depend_files : glapi_gen_depends,
166  capture : true,
167)
168
169glapitemp_h = custom_target(
170  'glapitemp.h',
171  input : ['gl_apitemp.py', 'gl_and_es_API.xml'],
172  output : 'glapitemp.h',
173  command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'],
174  depend_files : glapi_gen_depends,
175  capture : true,
176)
177
178glapitable_h = custom_target(
179  'glapitable.h',
180  input : ['gl_table.py', 'gl_and_es_API.xml'],
181  output : 'glapitable.h',
182  command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'],
183  depend_files : glapi_gen_depends,
184  capture : true,
185)
186
187glapi_gentable_c = custom_target(
188  'glapi_gentable.c',
189  input : ['gl_gentable.py', 'gl_and_es_API.xml'],
190  output : 'glapi_gentable.c',
191  command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'],
192  depend_files : glapi_gen_depends,
193  capture : true,
194)
195
196main_enums_c = custom_target(
197  'enums.c',
198  input : ['gl_enums.py', files('../registry/gl.xml')],
199  output : 'enums.c',
200  command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'],
201  capture : true,
202)
203
204main_api_exec_c = custom_target(
205  'api_exec.c',
206  input : ['gl_genexec.py', 'gl_and_es_API.xml'],
207  output : 'api_exec.c',
208  command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'],
209  depend_files : files('apiexec.py') + glapi_gen_depends,
210  capture : true,
211)
212
213main_marshal_generated_c = custom_target(
214  'marshal_generated.c',
215  input : ['gl_marshal.py', 'gl_and_es_API.xml'],
216  output : 'marshal_generated.c',
217  command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'],
218  depend_files : files('marshal_XML.py') + glapi_gen_depends,
219  capture : true,
220)
221
222glx_generated = []
223
224foreach x : [['indirect.c', 'proto'], ['indirect.h', 'init_h'], ['indirect_init.c', 'init_c']]
225  glx_generated += custom_target(
226    x[0],
227    input : ['glX_proto_send.py', 'gl_API.xml'],
228    output : x[0],
229    command : [prog_python, '@INPUT0@', '-f', '@INPUT1@', '-m', x[1]],
230    depend_files : glx_gen_depends,
231    capture : true,
232  )
233endforeach
234
235foreach x : [['indirect_size.h', ['-m', 'size_h', '--header-tag', '_INDIRECT_SIZE_H_']],
236             ['indirect_size.c', ['-m', 'size_c']]]
237  glx_generated += custom_target(
238    x[0],
239    input : ['glX_proto_size.py', 'gl_API.xml'],
240    output : x[0],
241    command : [prog_python, '@INPUT0@', '-f', '@INPUT1@', '--only-set', x[1]],
242    depend_files : glx_gen_depends,
243    capture : true,
244  )
245endforeach
246glx_indirect_size_h = glx_generated[3]
247
248glapi_x86_s = custom_target(
249  'glapi_x86.S',
250  input : ['gl_x86_asm.py', gl_and_es_api_files],
251  output : 'glapi_x86.S',
252  command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'],
253  depend_files : glapi_gen_depends,
254  capture : true,
255)
256
257glapi_x86_64_s = custom_target(
258  'glapi_x86-64.S',
259  input : ['gl_x86-64_asm.py', gl_and_es_api_files],
260  output : 'glapi_x86-64.S',
261  command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'],
262  depend_files : glapi_gen_depends,
263  capture : true,
264)
265
266glapi_sparc_s = custom_target(
267  'glapi_sparc.S',
268  input : ['gl_SPARC_asm.py', gl_and_es_api_files],
269  output : 'glapi_sparc.S',
270  command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'],
271  depend_files : glapi_gen_depends,
272  capture : true,
273)
274