1bf215546Sopenharmony_ci# Copyright © 2017 Intel Corporation
2bf215546Sopenharmony_ci
3bf215546Sopenharmony_ci# Permission is hereby granted, free of charge, to any person obtaining a copy
4bf215546Sopenharmony_ci# of this software and associated documentation files (the "Software"), to deal
5bf215546Sopenharmony_ci# in the Software without restriction, including without limitation the rights
6bf215546Sopenharmony_ci# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7bf215546Sopenharmony_ci# copies of the Software, and to permit persons to whom the Software is
8bf215546Sopenharmony_ci# furnished to do so, subject to the following conditions:
9bf215546Sopenharmony_ci
10bf215546Sopenharmony_ci# The above copyright notice and this permission notice shall be included in
11bf215546Sopenharmony_ci# all copies or substantial portions of the Software.
12bf215546Sopenharmony_ci
13bf215546Sopenharmony_ci# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14bf215546Sopenharmony_ci# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15bf215546Sopenharmony_ci# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16bf215546Sopenharmony_ci# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17bf215546Sopenharmony_ci# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18bf215546Sopenharmony_ci# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19bf215546Sopenharmony_ci# SOFTWARE.
20bf215546Sopenharmony_ci
21bf215546Sopenharmony_ciinc_mesa = include_directories('mesa')
22bf215546Sopenharmony_ciinc_mapi = include_directories('mapi')
23bf215546Sopenharmony_ciinc_src = include_directories('.')
24bf215546Sopenharmony_ciinc_gallium = include_directories('gallium/include')
25bf215546Sopenharmony_ciinc_gallium_aux = include_directories('gallium/auxiliary')
26bf215546Sopenharmony_ciinc_amd_common = include_directories('amd/common')
27bf215546Sopenharmony_ciinc_tool = include_directories('tool')
28bf215546Sopenharmony_ciinc_virtio_gpu = include_directories('virtio/virtio-gpu')
29bf215546Sopenharmony_cipps_datasources = []
30bf215546Sopenharmony_cipps_includes = []
31bf215546Sopenharmony_ci
32bf215546Sopenharmony_ciif with_llvm
33bf215546Sopenharmony_ci  inc_amd_common_llvm = include_directories('amd/llvm')
34bf215546Sopenharmony_cielse
35bf215546Sopenharmony_ci  inc_amd_common_llvm = []
36bf215546Sopenharmony_ciendif
37bf215546Sopenharmony_ci
38bf215546Sopenharmony_cilibglsl_util = static_library(
39bf215546Sopenharmony_ci  'glsl_util',
40bf215546Sopenharmony_ci  files(
41bf215546Sopenharmony_ci    'mesa/main/extensions_table.c',
42bf215546Sopenharmony_ci    'mesa/program/prog_parameter.c',
43bf215546Sopenharmony_ci    'mesa/program/symbol_table.c',
44bf215546Sopenharmony_ci    'mesa/program/dummy_errors.c',
45bf215546Sopenharmony_ci  ),
46bf215546Sopenharmony_ci  include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
47bf215546Sopenharmony_ci  dependencies : dep_valgrind,
48bf215546Sopenharmony_ci  gnu_symbol_visibility : 'hidden',
49bf215546Sopenharmony_ci  build_by_default : false,
50bf215546Sopenharmony_ci)
51bf215546Sopenharmony_ci
52bf215546Sopenharmony_cisha1_h = custom_target(
53bf215546Sopenharmony_ci  'git_sha1.h',
54bf215546Sopenharmony_ci  output : 'git_sha1.h',
55bf215546Sopenharmony_ci  command : [prog_python, git_sha1_gen_py, '--output', '@OUTPUT@'],
56bf215546Sopenharmony_ci  build_by_default : true,
57bf215546Sopenharmony_ci  build_always_stale : true, # commit sha1 can change without having touched these files
58bf215546Sopenharmony_ci)
59bf215546Sopenharmony_ci
60bf215546Sopenharmony_cisubdir('gtest')
61bf215546Sopenharmony_ciif cc.get_argument_syntax() == 'msvc'
62bf215546Sopenharmony_ci  subdir('getopt')
63bf215546Sopenharmony_cielse
64bf215546Sopenharmony_ci  idep_getopt = null_dep
65bf215546Sopenharmony_ciendif
66bf215546Sopenharmony_cisubdir('android_stub')
67bf215546Sopenharmony_cisubdir('c11/impl')
68bf215546Sopenharmony_cisubdir('util')
69bf215546Sopenharmony_cisubdir('mapi')
70bf215546Sopenharmony_ci# TODO: opengl
71bf215546Sopenharmony_cisubdir('compiler')
72bf215546Sopenharmony_ciif with_tools.contains('drm-shim')
73bf215546Sopenharmony_ci  subdir('drm-shim')
74bf215546Sopenharmony_ciendif
75bf215546Sopenharmony_ciif with_imgui
76bf215546Sopenharmony_ci  subdir('imgui')
77bf215546Sopenharmony_ciendif
78bf215546Sopenharmony_ciif with_platform_wayland
79bf215546Sopenharmony_ci  subdir('egl/wayland/wayland-drm')
80bf215546Sopenharmony_ciendif
81bf215546Sopenharmony_ciif with_any_vk or with_gallium_zink
82bf215546Sopenharmony_ci  subdir('vulkan')
83bf215546Sopenharmony_ciendif
84bf215546Sopenharmony_ciif with_any_intel
85bf215546Sopenharmony_ci  subdir('intel')
86bf215546Sopenharmony_ciendif
87bf215546Sopenharmony_ciif with_gallium_radeonsi or with_amd_vk
88bf215546Sopenharmony_ci  subdir('amd')
89bf215546Sopenharmony_ciendif
90bf215546Sopenharmony_ciif with_any_broadcom
91bf215546Sopenharmony_ci  subdir('broadcom')
92bf215546Sopenharmony_ciendif
93bf215546Sopenharmony_ciif with_gallium_etnaviv
94bf215546Sopenharmony_ci  subdir('etnaviv')
95bf215546Sopenharmony_ciendif
96bf215546Sopenharmony_ciif with_gallium_freedreno or with_freedreno_vk or with_tools.contains('freedreno')
97bf215546Sopenharmony_ci  subdir('freedreno')
98bf215546Sopenharmony_ciendif
99bf215546Sopenharmony_ciif with_imagination_vk
100bf215546Sopenharmony_ci  subdir('imagination')
101bf215546Sopenharmony_ciendif
102bf215546Sopenharmony_ciif with_gallium_panfrost or with_gallium_lima or with_panfrost_vk or with_tools.contains('panfrost')
103bf215546Sopenharmony_ci  subdir('panfrost')
104bf215546Sopenharmony_ciendif
105bf215546Sopenharmony_ciif with_gallium_virgl or with_virtio_vk
106bf215546Sopenharmony_ci  subdir('virtio')
107bf215546Sopenharmony_ciendif
108bf215546Sopenharmony_ciif with_microsoft_clc or with_gallium_d3d12 or with_spirv_to_dxil or with_microsoft_vk
109bf215546Sopenharmony_ci  subdir('microsoft')
110bf215546Sopenharmony_ciendif
111bf215546Sopenharmony_ciif with_gallium_nouveau
112bf215546Sopenharmony_ci  subdir('nouveau')
113bf215546Sopenharmony_ciendif
114bf215546Sopenharmony_ciif with_gallium_asahi or with_tools.contains('asahi')
115bf215546Sopenharmony_ci  subdir('asahi')
116bf215546Sopenharmony_ciendif
117bf215546Sopenharmony_cisubdir('loader')
118bf215546Sopenharmony_ciif with_platform_haiku
119bf215546Sopenharmony_ci  subdir('hgl')
120bf215546Sopenharmony_ciendif
121bf215546Sopenharmony_ciif with_gbm
122bf215546Sopenharmony_ci  subdir('gbm')
123bf215546Sopenharmony_cielse
124bf215546Sopenharmony_ci  inc_gbm = []
125bf215546Sopenharmony_ciendif
126bf215546Sopenharmony_ciif with_gallium
127bf215546Sopenharmony_ci  subdir('mesa')
128bf215546Sopenharmony_ci  subdir('gallium')
129bf215546Sopenharmony_ci  if with_glx == 'dri'
130bf215546Sopenharmony_ci     subdir('glx')
131bf215546Sopenharmony_ci  endif
132bf215546Sopenharmony_ci  # This has to be here since it requires libgallium, and subdir cannot
133bf215546Sopenharmony_ci  # contain ..
134bf215546Sopenharmony_ci  if with_tests
135bf215546Sopenharmony_ci    subdir('mesa/main/tests')
136bf215546Sopenharmony_ci  endif
137bf215546Sopenharmony_ci  if with_tests and with_shared_glapi
138bf215546Sopenharmony_ci    subdir('mesa/state_tracker/tests')
139bf215546Sopenharmony_ci  endif
140bf215546Sopenharmony_ciendif
141bf215546Sopenharmony_ciif with_egl
142bf215546Sopenharmony_ci  subdir('egl')
143bf215546Sopenharmony_ciendif
144bf215546Sopenharmony_ci
145bf215546Sopenharmony_ci# This must be after at least mesa, glx, and gallium, since libgl will be
146bf215546Sopenharmony_ci# defined in one of those subdirs depending on the glx provider.
147bf215546Sopenharmony_ciif with_glx != 'disabled' and not with_glvnd
148bf215546Sopenharmony_ci  pkg.generate(
149bf215546Sopenharmony_ci    name : 'gl',
150bf215546Sopenharmony_ci    description : 'Mesa OpenGL Library',
151bf215546Sopenharmony_ci    version : meson.project_version(),
152bf215546Sopenharmony_ci    libraries : libgl,
153bf215546Sopenharmony_ci    libraries_private : gl_priv_libs,
154bf215546Sopenharmony_ci    requires_private : gl_priv_reqs,
155bf215546Sopenharmony_ci    variables : ['glx_tls=yes'],
156bf215546Sopenharmony_ci  )
157bf215546Sopenharmony_ciendif
158bf215546Sopenharmony_ci
159bf215546Sopenharmony_cisubdir('tool')
160