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