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