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 21subdir('program') 22subdir('main') 23 24# files shared between classic mesa and gallium mesa 25files_libmesa = files( 26 'main/accum.c', 27 'main/accum.h', 28 'main/api_arrayelt.c', 29 'main/api_arrayelt.h', 30 'main/arbprogram.c', 31 'main/arrayobj.c', 32 'main/arrayobj.h', 33 'main/atifragshader.c', 34 'main/atifragshader.h', 35 'main/attrib.c', 36 'main/attrib.h', 37 'main/barrier.c', 38 'main/bbox.c', 39 'main/bbox.h', 40 'main/blend.c', 41 'main/blend.h', 42 'main/blit.c', 43 'main/blit.h', 44 'main/bufferobj.c', 45 'main/bufferobj.h', 46 'main/buffers.c', 47 'main/buffers.h', 48 'main/clear.c', 49 'main/clip.c', 50 'main/clip.h', 51 'main/colormac.h', 52 'main/compute.c', 53 'main/condrender.c', 54 'main/condrender.h', 55 'main/config.h', 56 'main/conservativeraster.c', 57 'main/conservativeraster.h', 58 'main/context.c', 59 'main/context.h', 60 'main/copyimage.c', 61 'main/cpuinfo.c', 62 'main/cpuinfo.h', 63 'main/dd.h', 64 'main/debug.c', 65 'main/debug.h', 66 'main/debug_output.c', 67 'main/debug_output.h', 68 'main/depth.c', 69 'main/depth.h', 70 'main/dlist.c', 71 'main/dlist.h', 72 'main/draw.c', 73 'main/draw.h', 74 'main/draw_validate.c', 75 'main/draw_validate.h', 76 'main/drawpix.c', 77 'main/drawtex.c', 78 'main/enable.c', 79 'main/enable.h', 80 'main/enums.h', 81 'main/errors.c', 82 'main/errors.h', 83 'main/es1_conversion.c', 84 'main/eval.c', 85 'main/eval.h', 86 'main/extensions.c', 87 'main/extensions.h', 88 'main/extensions_table.c', 89 'main/extensions_table.h', 90 'main/externalobjects.c', 91 'main/externalobjects.h', 92 'main/fbobject.c', 93 'main/fbobject.h', 94 'main/feedback.c', 95 'main/feedback.h', 96 'main/ff_fragment_shader.cpp', 97 'main/ffvertex_prog.c', 98 'main/ffvertex_prog.h', 99 'main/fog.c', 100 'main/fog.h', 101 'main/format_pack.h', 102 'main/format_unpack.h', 103 'main/format_utils.c', 104 'main/format_utils.h', 105 'main/formatquery.c', 106 'main/formatquery.h', 107 'main/formats.c', 108 'main/formats.h', 109 'main/framebuffer.c', 110 'main/framebuffer.h', 111 'main/genmipmap.c', 112 'main/genmipmap.h', 113 'main/get.c', 114 'main/get.h', 115 'main/getstring.c', 116 'main/glformats.c', 117 'main/glformats.h', 118 'main/glheader.h', 119 'main/glspirv.c', 120 'main/glspirv.h', 121 'main/glthread.c', 122 'main/glthread.h', 123 'main/glthread_bufferobj.c', 124 'main/glthread_draw.c', 125 'main/glthread_get.c', 126 'main/glthread_list.c', 127 'main/glthread_marshal.h', 128 'main/glthread_shaderobj.c', 129 'main/glthread_varray.c', 130 'main/hash.c', 131 'main/hash.h', 132 'main/hint.c', 133 'main/hint.h', 134 'main/image.c', 135 'main/image.h', 136 'main/light.c', 137 'main/light.h', 138 'main/lines.c', 139 'main/lines.h', 140 'main/macros.h', 141 'main/matrix.c', 142 'main/matrix.h', 143 'main/menums.h', 144 'main/mesa_private.h', 145 'main/mipmap.c', 146 'main/mipmap.h', 147 'main/mtypes.h', 148 'main/multisample.c', 149 'main/multisample.h', 150 'main/objectlabel.c', 151 'main/pack.c', 152 'main/pack.h', 153 'main/pbo.c', 154 'main/pbo.h', 155 'main/performance_monitor.c', 156 'main/performance_monitor.h', 157 'main/performance_query.c', 158 'main/performance_query.h', 159 'main/pipelineobj.c', 160 'main/pipelineobj.h', 161 'main/pixel.c', 162 'main/pixel.h', 163 'main/pixelstore.c', 164 'main/pixelstore.h', 165 'main/pixeltransfer.c', 166 'main/pixeltransfer.h', 167 'main/points.c', 168 'main/points.h', 169 'main/polygon.c', 170 'main/polygon.h', 171 'main/program_binary.c', 172 'main/program_binary.h', 173 'main/program_resource.c', 174 'main/querymatrix.c', 175 'main/queryobj.c', 176 'main/queryobj.h', 177 'main/rastpos.c', 178 'main/rastpos.h', 179 'main/readpix.c', 180 'main/readpix.h', 181 'main/remap.c', 182 'main/remap.h', 183 'main/renderbuffer.c', 184 'main/renderbuffer.h', 185 'main/robustness.c', 186 'main/samplerobj.c', 187 'main/samplerobj.h', 188 'main/scissor.c', 189 'main/scissor.h', 190 'main/shader_query.cpp', 191 'main/shaderapi.c', 192 'main/shaderapi.h', 193 'main/shaderimage.c', 194 'main/shaderimage.h', 195 'main/shaderobj.c', 196 'main/shaderobj.h', 197 'main/shared.c', 198 'main/shared.h', 199 'main/spirv_extensions.c', 200 'main/spirv_extensions.h', 201 'main/state.c', 202 'main/state.h', 203 'main/stencil.c', 204 'main/stencil.h', 205 'main/syncobj.c', 206 'main/syncobj.h', 207 'main/texcompress.c', 208 'main/texcompress.h', 209 'main/texcompress_astc.cpp', 210 'main/texcompress_astc.h', 211 'main/texcompress_bptc.c', 212 'main/texcompress_bptc.h', 213 'main/texcompress_cpal.c', 214 'main/texcompress_cpal.h', 215 'main/texcompress_etc.c', 216 'main/texcompress_etc.h', 217 'main/texcompress_etc_tmp.h', 218 'main/texcompress_fxt1.c', 219 'main/texcompress_fxt1.h', 220 'main/texcompress_rgtc.c', 221 'main/texcompress_rgtc.h', 222 'main/texcompress_s3tc.c', 223 'main/texcompress_s3tc.h', 224 'main/texenv.c', 225 'main/texenvprogram.h', 226 'main/texgen.c', 227 'main/texgetimage.c', 228 'main/texgetimage.h', 229 'main/teximage.c', 230 'main/teximage.h', 231 'main/texobj.c', 232 'main/texobj.h', 233 'main/texparam.c', 234 'main/texparam.h', 235 'main/texstate.c', 236 'main/texstate.h', 237 'main/texstorage.c', 238 'main/texstorage.h', 239 'main/texstore.c', 240 'main/texstore.h', 241 'main/texturebindless.c', 242 'main/texturebindless.h', 243 'main/textureview.c', 244 'main/textureview.h', 245 'main/transformfeedback.c', 246 'main/transformfeedback.h', 247 'main/uniform_query.cpp', 248 'main/uniforms.c', 249 'main/uniforms.h', 250 'main/varray.c', 251 'main/varray.h', 252 'main/vdpau.c', 253 'main/version.c', 254 'main/version.h', 255 'main/viewport.c', 256 'main/viewport.h', 257 'main/es1_conversion.c', 258 'math/m_debug.h', 259 'math/m_debug_clip.c', 260 'math/m_debug_norm.c', 261 'math/m_debug_util.h', 262 'math/m_debug_xform.c', 263 'math/m_eval.c', 264 'math/m_eval.h', 265 'math/m_matrix.c', 266 'math/m_matrix.h', 267 'math/m_vector.c', 268 'math/m_vector.h', 269 'program/arbprogparse.c', 270 'program/arbprogparse.h', 271 'program/link_program.cpp', 272 'program/link_program.h', 273 'program/prog_cache.c', 274 'program/prog_cache.h', 275 'program/prog_instruction.c', 276 'program/prog_instruction.h', 277 'program/prog_parameter.c', 278 'program/prog_parameter.h', 279 'program/prog_parameter_layout.c', 280 'program/prog_parameter_layout.h', 281 'program/prog_print.c', 282 'program/prog_print.h', 283 'program/prog_statevars.c', 284 'program/prog_statevars.h', 285 'program/prog_to_nir.c', 286 'program/prog_to_nir.h', 287 'program/program.c', 288 'program/program.h', 289 'program/program_parse_extra.c', 290 'program/program_parser.h', 291 'program/programopt.c', 292 'program/programopt.h', 293 'program/symbol_table.c', 294 'program/symbol_table.h', 295 'state_tracker/st_atifs_to_nir.c', 296 'state_tracker/st_atifs_to_nir.h', 297 'state_tracker/st_atom.c', 298 'state_tracker/st_atom_array.cpp', 299 'state_tracker/st_atom_atomicbuf.c', 300 'state_tracker/st_atom_blend.c', 301 'state_tracker/st_atom_clip.c', 302 'state_tracker/st_atom_constbuf.c', 303 'state_tracker/st_atom_constbuf.h', 304 'state_tracker/st_atom_depth.c', 305 'state_tracker/st_atom_framebuffer.c', 306 'state_tracker/st_atom_image.c', 307 'state_tracker/st_atom_list.h', 308 'state_tracker/st_atom_msaa.c', 309 'state_tracker/st_atom_pixeltransfer.c', 310 'state_tracker/st_atom_rasterizer.c', 311 'state_tracker/st_atom_sampler.c', 312 'state_tracker/st_atom_scissor.c', 313 'state_tracker/st_atom_shader.c', 314 'state_tracker/st_atom_stipple.c', 315 'state_tracker/st_atom_storagebuf.c', 316 'state_tracker/st_atom_tess.c', 317 'state_tracker/st_atom_texture.c', 318 'state_tracker/st_atom_viewport.c', 319 'state_tracker/st_cb_bitmap.c', 320 'state_tracker/st_cb_bitmap.h', 321 'state_tracker/st_cb_clear.c', 322 'state_tracker/st_cb_clear.h', 323 'state_tracker/st_cb_copyimage.c', 324 'state_tracker/st_cb_copyimage.h', 325 'state_tracker/st_cb_drawpixels.c', 326 'state_tracker/st_cb_drawpixels.h', 327 'state_tracker/st_cb_drawtex.c', 328 'state_tracker/st_cb_drawtex.h', 329 'state_tracker/st_cb_eglimage.c', 330 'state_tracker/st_cb_eglimage.h', 331 'state_tracker/st_cb_feedback.c', 332 'state_tracker/st_cb_feedback.h', 333 'state_tracker/st_cb_flush.c', 334 'state_tracker/st_cb_flush.h', 335 'state_tracker/st_cb_rasterpos.c', 336 'state_tracker/st_cb_rasterpos.h', 337 'state_tracker/st_cb_readpixels.c', 338 'state_tracker/st_cb_readpixels.h', 339 'state_tracker/st_cb_texture.c', 340 'state_tracker/st_cb_texture.h', 341 'state_tracker/st_context.c', 342 'state_tracker/st_context.h', 343 'state_tracker/st_copytex.c', 344 'state_tracker/st_copytex.h', 345 'state_tracker/st_debug.c', 346 'state_tracker/st_debug.h', 347 'state_tracker/st_draw.c', 348 'state_tracker/st_draw.h', 349 'state_tracker/st_draw_feedback.c', 350 'state_tracker/st_draw_hw_select.c', 351 'state_tracker/st_extensions.c', 352 'state_tracker/st_extensions.h', 353 'state_tracker/st_format.c', 354 'state_tracker/st_format.h', 355 'state_tracker/st_gen_mipmap.c', 356 'state_tracker/st_gen_mipmap.h', 357 'state_tracker/st_gl_api.h', 358 'state_tracker/st_glsl_to_ir.cpp', 359 'state_tracker/st_glsl_to_ir.h', 360 'state_tracker/st_glsl_to_nir.cpp', 361 'state_tracker/st_manager.c', 362 'state_tracker/st_manager.h', 363 'state_tracker/st_nir.h', 364 'state_tracker/st_nir_builtins.c', 365 'state_tracker/st_nir_lower_builtin.c', 366 'state_tracker/st_nir_lower_tex_src_plane.c', 367 'state_tracker/st_pbo.c', 368 'state_tracker/st_pbo_compute.c', 369 'state_tracker/st_pbo.h', 370 'state_tracker/st_program.c', 371 'state_tracker/st_program.h', 372 'state_tracker/st_sampler_view.c', 373 'state_tracker/st_sampler_view.h', 374 'state_tracker/st_scissor.c', 375 'state_tracker/st_scissor.h', 376 'state_tracker/st_shader_cache.c', 377 'state_tracker/st_shader_cache.h', 378 'state_tracker/st_texture.c', 379 'state_tracker/st_texture.h', 380 'state_tracker/st_util.h', 381 'state_tracker/st_vdpau.c', 382 'state_tracker/st_vdpau.h', 383 'vbo/vbo.h', 384 'vbo/vbo_attrib.h', 385 'vbo/vbo_attrib_tmp.h', 386 'vbo/vbo_context.c', 387 'vbo/vbo_exec.c', 388 'vbo/vbo_exec.h', 389 'vbo/vbo_exec_api.c', 390 'vbo/vbo_exec_draw.c', 391 'vbo/vbo_exec_eval.c', 392 'vbo/vbo_minmax_index.c', 393 'vbo/vbo_noop.c', 394 'vbo/vbo_save.c', 395 'vbo/vbo_save.h', 396 'vbo/vbo_save_api.c', 397 'vbo/vbo_save_draw.c', 398 'vbo/vbo_save_loopback.c', 399 'vbo/vbo_util.h', 400 'x86/common_x86.c', 401) 402 403inc_libmesa_asm = [] 404if with_asm_arch == 'x86' 405 files_libmesa += files( 406 'x86/assyntax.h', 407 'x86/common_x86_asm.S', 408 'x86/common_x86_asm.h', 409 'x86/common_x86_features.h', 410 'x86/read_rgba_span_x86.S', 411 ) 412 inc_libmesa_asm = include_directories('x86') 413endif 414 415format_fallback_c = custom_target( 416 'format_fallback.c', 417 input : ['main/format_fallback.py', 'main/formats.csv'], 418 output : 'format_fallback.c', 419 command : [prog_python, '@INPUT0@', '@INPUT1@', '@OUTPUT@'], 420 depend_files : files('main/format_parser.py'), 421) 422 423get_hash_h = custom_target( 424 'get_hash.h', 425 input : ['main/get_hash_generator.py', gl_and_es_api_files], 426 output : 'get_hash.h', 427 command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'], 428 depend_files : files('main/get_hash_params.py'), 429 capture : true, 430) 431 432foreach x : [['format_info.h', 'format_info.py']] 433 files_libmesa += custom_target( 434 x[0], 435 input : ['main/@0@'.format(x[1]), 'main/formats.csv'], 436 output : x[0], 437 command : [prog_python, '@INPUT0@', '@INPUT1@'], 438 depend_files : files('main/format_parser.py'), 439 capture : true, 440 ) 441endforeach 442 443files_libmesa += [ 444 mesa_lex, 445 program_parse_tab, 446 main_api_exec_c, 447 main_api_exec_decl_h, 448 main_api_save_h, 449 main_api_save_init_h, 450 main_api_vtxfmt_init_h, 451 main_api_hw_select_init_h, 452 main_enums_c, 453 format_fallback_c, 454 get_hash_h, 455 main_marshal_generated_h, 456 main_dispatch_h, 457 ir_expression_operation_h, 458 main_remap_helper_h, 459 sha1_h, 460] + main_marshal_generated_c 461 462if with_sse41 463 libmesa_sse41 = static_library( 464 'mesa_sse41', 465 files('main/sse_minmax.c'), 466 c_args : [c_msvc_compat_args, sse41_args], 467 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], 468 gnu_symbol_visibility : 'hidden', 469 ) 470else 471 libmesa_sse41 = [] 472endif 473 474_mesa_windows_args = [] 475if with_platform_windows 476 _mesa_windows_args += [ 477 '-D_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers 478 ] 479 if not with_shared_glapi 480 # prevent _glapi_* from being declared __declspec(dllimport) 481 _mesa_windows_args += '-D_GLAPI_NO_EXPORTS' 482 endif 483endif 484 485libmesa = static_library( 486 'mesa', 487 files_libmesa, 488 c_args : [c_msvc_compat_args, _mesa_windows_args], 489 cpp_args : [cpp_msvc_compat_args, _mesa_windows_args], 490 gnu_symbol_visibility : 'hidden', 491 include_directories : [ 492 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, 493 inc_libmesa_asm, include_directories('main'), 494 ], 495 link_with : [libglsl, libmesa_sse41], 496 dependencies : [idep_nir_headers, dep_vdpau, idep_mesautil], 497 build_by_default : false, 498) 499 500