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('gtest') 22subdir('c11/impl') 23subdir('android_stub') 24subdir('util') 25 26inc_mesa = include_directories('mesa') 27inc_mapi = include_directories('mapi') 28inc_src = include_directories('.') 29inc_gallium = include_directories('gallium/include') 30inc_gallium_aux = include_directories('gallium/auxiliary') 31inc_amd_common = include_directories('amd/common') 32inc_tool = include_directories('tool') 33inc_virtio_gpu = include_directories('virtio/virtio-gpu') 34inc_frontends = include_directories('gallium/frontends') 35pps_datasources = [] 36pps_includes = [] 37 38inc_llvmpipe = include_directories('gallium/drivers/llvmpipe') 39 40if with_llvm 41 inc_amd_common_llvm = include_directories('amd/llvm') 42else 43 inc_amd_common_llvm = [] 44endif 45 46glsl_util_files = files( 47 'mesa/main/extensions_table.c', 48 'mesa/program/prog_parameter.c', 49 'mesa/program/symbol_table.c', 50 'mesa/program/dummy_errors.c', 51) 52 53sha1_h = custom_target( 54 'git_sha1.h', 55 output : 'git_sha1.h', 56 command : [prog_python, git_sha1_gen_py, '--output', '@OUTPUT@'], 57 build_by_default : true, 58 build_always_stale : true, # commit sha1 can change without having touched these files 59) 60 61if cc.get_argument_syntax() == 'msvc' 62 subdir('getopt') 63else 64 idep_getopt = null_dep 65endif 66if with_gallium or with_gbm or with_platform_wayland 67 subdir('loader') 68endif 69if with_gallium 70 subdir('mapi') 71endif 72if with_vk_compiler 73 subdir('compiler') 74endif 75if with_tools.contains('drm-shim') 76 subdir('drm-shim') 77endif 78if with_imgui 79 subdir('imgui') 80endif 81if with_platform_wayland 82 subdir('egl/wayland/wayland-drm') 83endif 84if with_any_vk or with_gallium_zink 85 subdir('vulkan') 86endif 87if with_any_intel 88 subdir('intel') 89endif 90if with_gallium_radeonsi or with_amd_vk or with_gallium_r300 or with_gallium_r600 91 subdir('amd') 92endif 93if with_any_broadcom 94 subdir('broadcom') 95endif 96if with_gallium_etnaviv 97 subdir('etnaviv') 98endif 99if system_has_kms_drm or with_gallium_virgl 100 subdir('virtio') 101endif 102if with_gallium_freedreno or with_freedreno_vk or with_tools.contains('freedreno') 103 subdir('freedreno') 104endif 105if with_imagination_vk 106 subdir('imagination') 107endif 108if with_gallium_panfrost or with_gallium_lima or with_panfrost_vk or with_tools.contains('panfrost') 109 subdir('panfrost') 110endif 111#if with_gallium_virgl or with_virtio_vk 112# subdir('virtio') 113#endif 114if with_microsoft_clc or with_gallium_d3d12 or with_spirv_to_dxil or with_microsoft_vk 115 subdir('microsoft') 116endif 117if with_any_nouveau 118 subdir('nouveau') 119endif 120if with_gfxstream_vk or with_gfxstream_backend 121 subdir('gfxstream') 122endif 123if with_gallium_asahi or with_tools.contains('asahi') 124 subdir('asahi') 125endif 126if with_gbm 127 subdir('gbm') 128else 129 inc_gbm = [] 130endif 131if with_gallium 132 subdir('mesa') 133 subdir('gallium') 134 if with_glx == 'dri' 135 subdir('glx') 136 endif 137 # This has to be here since it requires libgallium, and subdir cannot 138 # contain .. 139 if with_tests 140 subdir('mesa/main/tests') 141 endif 142 if with_tests and with_shared_glapi 143 subdir('mesa/state_tracker/tests') 144 endif 145endif 146if with_egl 147 subdir('egl') 148endif 149 150# This must be after at least mesa, glx, and gallium, since libgl will be 151# defined in one of those subdirs depending on the glx provider. 152if with_glx != 'disabled' and not with_glvnd 153 pkg.generate( 154 name : 'gl', 155 description : 'Mesa OpenGL Library', 156 version : meson.project_version(), 157 libraries : libgl, 158 libraries_private : gl_priv_libs, 159 requires_private : gl_priv_reqs, 160 variables : ['glx_tls=yes'], 161 ) 162endif 163 164subdir('tool') 165