blob: 0c60f9bc4637d5b29dea91d4364e4c34831e5b7f [file] [log] [blame]
Dylan Bakerd1992252017-09-14 17:57:17 -07001# 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
Dylan Bakerd1992252017-09-14 17:57:17 -070021inc_mesa = include_directories('mesa')
22inc_mapi = include_directories('mapi')
Dylan Baker32180562017-09-20 20:11:32 -070023inc_src = include_directories('.')
Dylan Baker06c66752017-10-20 22:23:15 -070024inc_gallium = include_directories('gallium/include')
25inc_gallium_aux = include_directories('gallium/auxiliary')
Dylan Baker5060c512017-10-25 18:55:38 -070026inc_amd_common = include_directories('amd/common')
Timur Kristóf3a081102019-09-27 10:29:51 +020027inc_amd_common_llvm = include_directories('amd/llvm')
Dylan Baker32180562017-09-20 20:11:32 -070028
29libglsl_util = static_library(
30 'glsl_util',
Dylan Bakerfbf192a2017-12-11 15:56:08 -080031 files(
Marek Olšáke5339fe2020-03-25 21:11:44 -040032 'mesa/main/extensions_table.c',
Dylan Baker8e369612018-09-14 12:57:32 -070033 'mesa/program/prog_parameter.c',
34 'mesa/program/symbol_table.c',
Dylan Bakerfbf192a2017-12-11 15:56:08 -080035 'mesa/program/dummy_errors.c',
36 ),
Eric Engestrom79af3072019-03-05 16:21:47 +000037 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
Rob Clark53f7d532020-11-17 11:29:52 -080038 dependencies : dep_valgrind,
Dylan Bakera8e2d792020-04-24 13:10:41 -070039 gnu_symbol_visibility : 'hidden',
Dylan Baker32180562017-09-20 20:11:32 -070040 build_by_default : false,
41)
42
Eric Engestrom05a94a42017-10-24 18:03:39 +010043sha1_h = custom_target(
44 'git_sha1.h',
Dylan Baker32180562017-09-20 20:11:32 -070045 output : 'git_sha1.h',
Mathieu Bridon2ee1c862018-08-09 10:27:26 +020046 command : [prog_python, git_sha1_gen_py, '--output', '@OUTPUT@'],
Dylan Baker6ef314b2020-04-24 12:29:42 -070047 build_by_default : true,
48 build_always_stale : true, # commit sha1 can change without having touched these files
Dylan Baker32180562017-09-20 20:11:32 -070049)
Dylan Bakerd1992252017-09-14 17:57:17 -070050
51subdir('gtest')
Dylan Bakerf680cc62018-02-08 13:10:12 -080052if cc.get_id() == 'msvc'
53 subdir('getopt')
54else
55 idep_getopt = null_dep
56endif
Kristian H. Kristensen932f51d2020-07-28 15:25:49 -070057subdir('android_stub')
Dylan Bakerd1992252017-09-14 17:57:17 -070058subdir('util')
Dylan Baker32180562017-09-20 20:11:32 -070059subdir('mapi')
Dylan Bakerd1992252017-09-14 17:57:17 -070060# TODO: opengl
Dylan Bakerd1992252017-09-14 17:57:17 -070061subdir('compiler')
Eric Anholt82bf1972018-09-25 19:15:45 -070062if with_tools.contains('drm-shim')
63 subdir('drm-shim')
64endif
Samuel Pitoisetd6db8582019-11-22 12:16:50 +010065if with_imgui
66 subdir('imgui')
67endif
Eric Engestrom4fa2fb32018-10-11 16:00:04 +010068if with_platform_wayland
69 subdir('egl/wayland/wayland-drm')
70endif
Iago Toral Quiroga92022f22020-10-30 10:44:17 +010071if with_any_vk or with_gallium_zink
Eric Engestrom3832db22018-10-11 16:21:14 +010072 subdir('vulkan')
73endif
Dylan Baker46a7fdd2017-11-13 11:16:28 -080074if with_gallium_radeonsi or with_amd_vk
75 subdir('amd')
76endif
Eric Anholt81a0f1e2020-10-19 12:28:17 -070077if with_any_broadcom
Eric Anholt1ae80182017-10-12 13:53:12 -070078 subdir('broadcom')
79endif
Guido Güntherb921df32019-05-31 14:35:08 +020080if with_gallium_etnaviv
81 subdir('etnaviv')
82endif
Bas Nieuwenhuizen26380b32018-08-08 22:23:57 +000083if with_gallium_freedreno or with_freedreno_vk
Rob Clarkb4476132018-11-11 10:10:46 -050084 subdir('freedreno')
85endif
Alyssa Rosenzweig41324222019-06-18 11:16:21 -070086if with_gallium_panfrost or with_gallium_lima
87 subdir('panfrost')
88endif
Chia-I Wub0736f42020-06-03 13:18:30 -070089if with_gallium_virgl or with_virtio_vk
Chia-I Wu42e29fe2020-07-02 11:06:15 -070090 subdir('virtio')
91endif
Eric Anholt81a0f1e2020-10-19 12:28:17 -070092if with_any_intel
Dylan Baker49fa0742017-11-13 11:14:47 -080093 subdir('intel')
94endif
Michael Tang67e48be2020-12-21 14:58:47 -080095if with_microsoft_clc or with_gallium_d3d12 or with_spirv_to_dxil
Erik Faye-Lund2ea15cd2019-05-26 10:43:12 +020096 subdir('microsoft')
97endif
Ilia Mirkin059ae7c2021-01-09 01:33:08 -050098if with_gallium_nouveau
99 subdir('nouveau')
100endif
Dylan Baker32180562017-09-20 20:11:32 -0700101subdir('mesa')
Dylan Bakera47c5252017-09-22 12:55:00 -0700102subdir('loader')
Alexander von Gluck IV834d2212018-02-16 16:56:31 -0600103if with_platform_haiku
104 subdir('hgl')
105endif
Emil Velikov9527f9e2018-12-12 17:47:36 +0000106if with_glx == 'dri'
Alexander von Gluck IV834d2212018-02-16 16:56:31 -0600107 subdir('glx')
108endif
Dylan Baker816bf7d12017-09-28 15:53:53 -0700109if with_gbm
110 subdir('gbm')
Dylan Baker5fcadae2018-01-03 12:33:55 -0800111else
112 inc_gbm = []
Dylan Baker816bf7d12017-09-28 15:53:53 -0700113endif
Dylan Baker108d2572017-10-18 12:20:43 -0700114if with_egl
115 subdir('egl')
116endif
Dylan Baker689fb742017-11-14 17:03:39 -0800117if with_gallium
118 subdir('gallium')
Dylan Baker34cb4d02018-02-06 15:46:25 -0800119 # This has to be here since it requires libgallium, and subdir cannot
120 # contain ..
Dylan Bakerd84f0032018-10-05 09:36:05 -0700121 if with_tests and with_shared_glapi
Dylan Bakerc73abb42018-04-18 09:29:35 -0700122 subdir('mesa/state_tracker/tests')
123 endif
Dylan Baker689fb742017-11-14 17:03:39 -0800124endif
Dylan Baker13752af2017-11-02 16:51:40 -0700125
126# This must be after at least mesa, glx, and gallium, since libgl will be
127# defined in one of those subdirs depending on the glx provider.
Eric Engestrom6e21dcc2019-09-25 17:38:49 +0100128if with_glx != 'disabled' and not with_glvnd
Dylan Baker13752af2017-11-02 16:51:40 -0700129 pkg.generate(
130 name : 'gl',
131 description : 'Mesa OpenGL Library',
132 version : meson.project_version(),
Eric Engestrom6e21dcc2019-09-25 17:38:49 +0100133 libraries : libgl,
Dylan Baker13752af2017-11-02 16:51:40 -0700134 libraries_private : gl_priv_libs,
135 requires_private : gl_priv_reqs,
Eric Engestrom9ac16862019-11-21 22:14:50 +0000136 variables : ['glx_tls=@0@'.format(use_elf_tls ? 'yes' : 'no')],
Dylan Baker13752af2017-11-02 16:51:40 -0700137 )
138endif