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