1# Copyright © 2017 Intel Corporation 2# SPDX-License-Identifier: MIT 3 4osmesa_link_with = [] 5osmesa_link_args = [] 6osmesa_link_deps = [] 7 8if with_shared_glapi 9 osmesa_link_with += libglapi 10endif 11if with_ld_version_script 12 osmesa_link_args += [ 13 '-Wl,--version-script', join_paths(meson.current_source_dir(), 'osmesa.sym') 14 ] 15 osmesa_link_deps += files('osmesa.sym') 16endif 17 18osmesa_def = custom_target( 19 'osmesa.def', 20 input: 'osmesa.def.in', 21 output : 'osmesa.def', 22 command : gen_vs_module_defs_normal_command, 23) 24 25libosmesa = shared_library( 26 osmesa_lib_name, 27 'osmesa_target.c', 28 gnu_symbol_visibility : 'hidden', 29 link_args : [ld_args_gc_sections, osmesa_link_args], 30 vs_module_defs : osmesa_def, 31 include_directories : [ 32 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_winsys, 33 inc_gallium_drivers, 34 ], 35 link_depends : osmesa_link_deps, 36 link_whole : [libosmesa_st, libglapi_static], 37 link_with : [ 38 libmesa, libgallium, libws_null, osmesa_link_with, 39 ], 40 dependencies : [ 41 dep_ws2_32, dep_selinux, dep_thread, dep_clock, dep_unwind, driver_swrast, idep_mesautil, 42 ], 43 name_prefix : host_machine.system() == 'windows' ? '' : [], # otherwise mingw will create libosmesa.dll 44 soversion : host_machine.system() == 'windows' ? '' : '8', 45 version : '8.0.0', 46 darwin_versions : '9.0.0', 47 install : true, 48) 49 50if with_symbols_check 51 test('osmesa-symbols-check', 52 symbols_check, 53 args : [ 54 '--lib', libosmesa, 55 '--symbols-file', files('osmesa-symbols.txt'), 56 symbols_check_args, 57 ], 58 suite : ['gallium'], 59 ) 60endif 61 62pkg.generate( 63 name : 'osmesa', 64 description : 'Mesa Off-screen Rendering Library', 65 version : '8.0.0', 66 libraries : libosmesa, 67 libraries_private : gl_priv_libs, 68) 69 70if with_tests 71 test('osmesa-render', 72 executable( 73 'osmesa-render', 74 'test-render.cpp', 75 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], 76 link_with: libosmesa, 77 dependencies : [idep_gtest, idep_mesautil], 78 ), 79 suite: 'gallium', 80 protocol : 'gtest', 81 ) 82endif 83