101e04c3fSmrg# Copyright © 2017 Intel Corporation
201e04c3fSmrg
301e04c3fSmrg# Permission is hereby granted, free of charge, to any person obtaining a copy
401e04c3fSmrg# of this software and associated documentation files (the "Software"), to deal
501e04c3fSmrg# in the Software without restriction, including without limitation the rights
601e04c3fSmrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
701e04c3fSmrg# copies of the Software, and to permit persons to whom the Software is
801e04c3fSmrg# furnished to do so, subject to the following conditions:
901e04c3fSmrg
1001e04c3fSmrg# The above copyright notice and this permission notice shall be included in
1101e04c3fSmrg# all copies or substantial portions of the Software.
1201e04c3fSmrg
1301e04c3fSmrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1401e04c3fSmrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1501e04c3fSmrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1601e04c3fSmrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1701e04c3fSmrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1801e04c3fSmrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1901e04c3fSmrg# SOFTWARE.
2001e04c3fSmrg
2101e04c3fSmrgfiles_llvmpipe = files(
2201e04c3fSmrg  'lp_bld_alpha.c',
2301e04c3fSmrg  'lp_bld_alpha.h',
2401e04c3fSmrg  'lp_bld_blend_aos.c',
2501e04c3fSmrg  'lp_bld_blend.c',
2601e04c3fSmrg  'lp_bld_blend.h',
2701e04c3fSmrg  'lp_bld_blend_logicop.c',
2801e04c3fSmrg  'lp_bld_depth.c',
2901e04c3fSmrg  'lp_bld_depth.h',
3001e04c3fSmrg  'lp_bld_interp.c',
3101e04c3fSmrg  'lp_bld_interp.h',
3201e04c3fSmrg  'lp_clear.c',
3301e04c3fSmrg  'lp_clear.h',
3401e04c3fSmrg  'lp_context.c',
3501e04c3fSmrg  'lp_context.h',
367ec681f3Smrg  'lp_cs_tpool.h',
377ec681f3Smrg  'lp_cs_tpool.c',
3801e04c3fSmrg  'lp_debug.h',
3901e04c3fSmrg  'lp_draw_arrays.c',
4001e04c3fSmrg  'lp_fence.c',
4101e04c3fSmrg  'lp_fence.h',
4201e04c3fSmrg  'lp_flush.c',
4301e04c3fSmrg  'lp_flush.h',
4401e04c3fSmrg  'lp_jit.c',
4501e04c3fSmrg  'lp_jit.h',
4601e04c3fSmrg  'lp_limits.h',
477ec681f3Smrg  'lp_linear.c',
487ec681f3Smrg  'lp_linear_fastpath.c',
497ec681f3Smrg  'lp_linear_interp.c',
507ec681f3Smrg  'lp_linear_sampler.c',
5101e04c3fSmrg  'lp_memory.c',
5201e04c3fSmrg  'lp_memory.h',
5301e04c3fSmrg  'lp_perf.c',
5401e04c3fSmrg  'lp_perf.h',
5501e04c3fSmrg  'lp_public.h',
5601e04c3fSmrg  'lp_query.c',
5701e04c3fSmrg  'lp_query.h',
5801e04c3fSmrg  'lp_rast.c',
5901e04c3fSmrg  'lp_rast_debug.c',
6001e04c3fSmrg  'lp_rast.h',
617ec681f3Smrg  'lp_rast_linear.c',
627ec681f3Smrg  'lp_rast_linear_fallback.c',
6301e04c3fSmrg  'lp_rast_priv.h',
647ec681f3Smrg  'lp_rast_rect.c',
6501e04c3fSmrg  'lp_rast_tri.c',
6601e04c3fSmrg  'lp_rast_tri_tmp.h',
6701e04c3fSmrg  'lp_scene.c',
6801e04c3fSmrg  'lp_scene.h',
6901e04c3fSmrg  'lp_scene_queue.c',
7001e04c3fSmrg  'lp_scene_queue.h',
7101e04c3fSmrg  'lp_screen.c',
7201e04c3fSmrg  'lp_screen.h',
7301e04c3fSmrg  'lp_setup.c',
747ec681f3Smrg  'lp_setup_analysis.c',
7501e04c3fSmrg  'lp_setup_context.h',
7601e04c3fSmrg  'lp_setup.h',
7701e04c3fSmrg  'lp_setup_line.c',
7801e04c3fSmrg  'lp_setup_point.c',
797ec681f3Smrg  'lp_setup_rect.c',
8001e04c3fSmrg  'lp_setup_tri.c',
8101e04c3fSmrg  'lp_setup_vbuf.c',
8201e04c3fSmrg  'lp_state_blend.c',
8301e04c3fSmrg  'lp_state_clip.c',
8401e04c3fSmrg  'lp_state_derived.c',
857ec681f3Smrg  'lp_state_cs.c',
867ec681f3Smrg  'lp_state_cs.h',
8701e04c3fSmrg  'lp_state_fs.c',
8801e04c3fSmrg  'lp_state_fs.h',
897ec681f3Smrg  'lp_state_fs_analysis.c',
907ec681f3Smrg  'lp_state_fs_fastpath.c',
917ec681f3Smrg  'lp_state_fs_linear.c',
927ec681f3Smrg  'lp_state_fs_linear_llvm.c',
9301e04c3fSmrg  'lp_state_gs.c',
9401e04c3fSmrg  'lp_state.h',
9501e04c3fSmrg  'lp_state_rasterizer.c',
9601e04c3fSmrg  'lp_state_sampler.c',
9701e04c3fSmrg  'lp_state_setup.c',
9801e04c3fSmrg  'lp_state_setup.h',
9901e04c3fSmrg  'lp_state_so.c',
10001e04c3fSmrg  'lp_state_surface.c',
1017ec681f3Smrg  'lp_state_tess.c',
10201e04c3fSmrg  'lp_state_vertex.c',
10301e04c3fSmrg  'lp_state_vs.c',
10401e04c3fSmrg  'lp_surface.c',
10501e04c3fSmrg  'lp_surface.h',
10601e04c3fSmrg  'lp_tex_sample.c',
10701e04c3fSmrg  'lp_tex_sample.h',
10801e04c3fSmrg  'lp_texture.c',
10901e04c3fSmrg  'lp_texture.h',
11001e04c3fSmrg)
11101e04c3fSmrg
11201e04c3fSmrglibllvmpipe = static_library(
11301e04c3fSmrg  'llvmpipe',
1147ec681f3Smrg  [files_llvmpipe, sha1_h],
1157ec681f3Smrg  c_args : [c_msvc_compat_args],
1167ec681f3Smrg  cpp_args : [cpp_msvc_compat_args],
1177ec681f3Smrg  gnu_symbol_visibility : 'hidden',
11801e04c3fSmrg  include_directories : [inc_gallium, inc_gallium_aux, inc_include, inc_src],
1197ec681f3Smrg  dependencies : [ dep_llvm, idep_nir_headers, idep_mesautil ],
12001e04c3fSmrg)
12101e04c3fSmrg
12201e04c3fSmrg# This overwrites the softpipe driver dependency, but itself depends on the
12301e04c3fSmrg# softpipe dependency.
12401e04c3fSmrgdriver_swrast = declare_dependency(
12501e04c3fSmrg  compile_args : '-DGALLIUM_LLVMPIPE',
12601e04c3fSmrg  link_with : libllvmpipe,
1277ec681f3Smrg  dependencies : [driver_swrast, dep_llvm, idep_mesautil],
12801e04c3fSmrg)
12901e04c3fSmrg
1307ec681f3Smrgif with_tests and with_gallium_softpipe and draw_with_llvm
13101e04c3fSmrg  foreach t : ['lp_test_format', 'lp_test_arit', 'lp_test_blend',
13201e04c3fSmrg               'lp_test_conv', 'lp_test_printf']
13301e04c3fSmrg    test(
13401e04c3fSmrg      t,
13501e04c3fSmrg      executable(
13601e04c3fSmrg        t,
1377ec681f3Smrg        ['@0@.c'.format(t), 'lp_test_main.c', sha1_h],
1387ec681f3Smrg        dependencies : [dep_llvm, dep_dl, dep_clock, idep_mesautil],
13901e04c3fSmrg        include_directories : [inc_gallium, inc_gallium_aux, inc_include, inc_src],
1407ec681f3Smrg        link_with : [libllvmpipe, libgallium],
1419f464c52Smaya      ),
1429f464c52Smaya      suite : ['llvmpipe'],
1437ec681f3Smrg      should_fail : meson.get_cross_property('xfail', '').contains(t),
1447ec681f3Smrg      timeout: 240,
14501e04c3fSmrg    )
14601e04c3fSmrg  endforeach
14701e04c3fSmrgendif
148