1# Copyright © 2017 Dylan Baker 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 21inc_st_dri = include_directories('.') 22deps_for_libdri = [] 23 24files_libdri = files( 25 'dri_context.c', 26 'dri_context.h', 27 'dri_drawable.c', 28 'dri_drawable.h', 29 'dri_helpers.c', 30 'dri_helpers.h', 31 'dri_query_renderer.c', 32 'dri_query_renderer.h', 33 'dri_screen.c', 34 'dri_screen.h', 35 'dri_util.c', 36 'dri_util.h', 37) 38 39if with_dri 40 files_libdri += files('drisw.c') 41endif 42 43if with_dri2 44 files_libdri += files('dri2.c') 45endif 46 47libdri_c_args = [] 48if with_gallium_zink and not with_platform_android 49 if get_option('glvnd') 50 libdri_c_args += '-DKOPPER_LIB_NAMES="libEGL_@0@ and libGLX_@0@"'.format(get_option('glvnd-vendor-name')) 51 else 52 libdri_c_args += '-DKOPPER_LIB_NAMES="libEGL and libGLX"' 53 endif 54 files_libdri += files('kopper.c') 55 deps_for_libdri += vulkan_wsi_deps 56endif 57 58if with_gallium_softpipe 59 libdri_c_args += '-DGALLIUM_SOFTPIPE' 60endif 61 62libdri = static_library( 63 'dri', 64 [ files_libdri, sha1_h ], 65 include_directories : [ 66 inc_include, inc_util, inc_mesa, inc_mapi, inc_src, inc_gallium, 67 inc_gallium_aux, inc_util, inc_gallium_drivers, inc_loader, 68 ], 69 c_args : [libdri_c_args], 70 gnu_symbol_visibility : 'hidden', 71 dependencies : [ 72 dep_libdrm, 73 idep_mesautil, 74 deps_for_libdri, 75 ], 76) 77 78if with_dri 79 dri_req_private = [] 80 if dep_libdrm.found() 81 dri_req_private = ['libdrm >= @0@'.format(_drm_ver)] 82 endif 83 84 pkg.generate( 85 name : 'dri', 86 filebase : 'dri', 87 description : 'Direct Rendering Infrastructure', 88 version : meson.project_version(), 89 variables : ['dridriverdir=@0@'.format(dri_drivers_path)], 90 requires_private : dri_req_private, 91 ) 92endif 93