1# Copyright © 2018 Collabora Ltd 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 21files_libzink = files( 22 'zink_lower_cubemap_to_array.c', 23 'nir_to_spirv/nir_to_spirv.c', 24 'nir_to_spirv/spirv_builder.c', 25 'zink_batch.c', 26 'zink_blit.c', 27 'zink_bo.c', 28 'zink_clear.c', 29 'zink_compiler.c', 30 'zink_context.c', 31 'zink_kopper.c', 32 'zink_descriptors.c', 33 'zink_descriptors_lazy.c', 34 'zink_draw.cpp', 35 'zink_fence.c', 36 'zink_format.c', 37 'zink_framebuffer.c', 38 'zink_pipeline.c', 39 'zink_program.c', 40 'zink_query.c', 41 'zink_render_pass.c', 42 'zink_resource.c', 43 'zink_screen.c', 44 'zink_state.c', 45 'zink_surface.c', 46) 47 48zink_device_info = custom_target( 49 'zink_device_info.c', 50 input : ['zink_device_info.py'], 51 output : ['zink_device_info.h', 'zink_device_info.c'], 52 command : [ 53 prog_python, '@INPUT@', '@OUTPUT@', join_paths(meson.source_root(), 'src/vulkan/registry/vk.xml') 54 ] 55) 56 57zink_instance = custom_target( 58 'zink_instance.c', 59 input : ['zink_instance.py'], 60 output : ['zink_instance.h', 'zink_instance.c'], 61 command : [ 62 prog_python, '@INPUT@', '@OUTPUT@', join_paths(meson.source_root(), 'src/vulkan/registry/vk.xml') 63 ] 64) 65 66zink_nir_algebraic_c = custom_target( 67 'zink_nir_algebraic.c', 68 input : 'nir_to_spirv/zink_nir_algebraic.py', 69 output : 'zink_nir_algebraic.c', 70 command : [ 71 prog_python, '@INPUT@', 72 '-p', join_paths(meson.source_root(), 'src/compiler/nir/'), 73 ], 74 capture : true, 75 depend_files : nir_algebraic_depends, 76) 77 78zink_c_args = [] 79inc_zink_vk = [] 80 81# MoltenVK options 82if with_moltenvk_dir != '' 83 inc_zink_vk = [inc_zink_vk, include_directories( join_paths(with_moltenvk_dir, 'include') )] 84 zink_c_args += ['-x','objective-c'] # Put compiler into objective-C mode to allow for MacOS types, like IOSurface and CAMetalLayer 85 zink_c_args += ['-iframework' , 'Foundation'] 86endif 87 88libzink = static_library( 89 'zink', 90 [files_libzink, zink_device_info, zink_instance, zink_nir_algebraic_c, vk_dispatch_table], 91 gnu_symbol_visibility : 'hidden', 92 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_vulkan_util, inc_zink_vk], 93 dependencies: [ 94 idep_nir_headers, idep_mesautil, idep_vulkan_util_headers, 95 idep_vulkan_wsi_headers, idep_vulkan_util, dep_libdrm 96 ], 97 c_args: zink_c_args, 98) 99 100driver_zink = declare_dependency( 101 compile_args : '-DGALLIUM_ZINK', 102 link_with : [libzink], 103) 104 105if with_tests 106 test( 107 'zink_format_test', 108 executable( 109 'zink_format_test', 110 ['zink_format_test.c', 'zink_format.c'], 111 dependencies : [idep_mesautil, idep_vulkan_util], 112 include_directories : [inc_gallium, inc_gallium_aux, inc_include, inc_src], 113 ), 114 suite : ['zink'], 115 ) 116endif 117