blob: 6213b7d8a361d2f81d48017bbe631ed5f246254a [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_common = include_directories(
22 '../include', '.', 'mapi', 'mesa', 'gallium/include', 'gallium/auxiliary')
23inc_mesa = include_directories('mesa')
24inc_mapi = include_directories('mapi')
Dylan Baker32180562017-09-20 20:11:32 -070025inc_src = include_directories('.')
Dylan Baker06c66752017-10-20 22:23:15 -070026inc_gallium = include_directories('gallium/include')
27inc_gallium_aux = include_directories('gallium/auxiliary')
Dylan Baker5060c512017-10-25 18:55:38 -070028inc_amd_common = include_directories('amd/common')
Dylan Baker32180562017-09-20 20:11:32 -070029
30libglsl_util = static_library(
31 'glsl_util',
Dylan Bakerfbf192a2017-12-11 15:56:08 -080032 files(
33 'mesa/main/extensions_table.c', 'mesa/main/imports.c',
34 'mesa/program/prog_parameter.c', 'mesa/program/symbol_table.c',
35 'mesa/program/dummy_errors.c',
36 ),
Dylan Baker32180562017-09-20 20:11:32 -070037 include_directories : [inc_common],
38 c_args : [c_vis_args],
39 build_by_default : false,
40)
41
Eric Engestrom05a94a42017-10-24 18:03:39 +010042sha1_h = custom_target(
43 'git_sha1.h',
Dylan Baker32180562017-09-20 20:11:32 -070044 output : 'git_sha1.h',
Eric Engestrom05a94a42017-10-24 18:03:39 +010045 command : [prog_python2, git_sha1_gen_py, '--output', '@OUTPUT@'],
46 build_always : true, # commit sha1 can change without having touched these files
Dylan Baker32180562017-09-20 20:11:32 -070047)
Dylan Bakerd1992252017-09-14 17:57:17 -070048
49subdir('gtest')
50subdir('util')
Dylan Baker32180562017-09-20 20:11:32 -070051subdir('mapi')
Dylan Bakerd1992252017-09-14 17:57:17 -070052# TODO: opengl
Dylan Bakerd1992252017-09-14 17:57:17 -070053subdir('compiler')
54subdir('egl/wayland/wayland-drm')
55subdir('vulkan')
Dylan Baker46a7fdd2017-11-13 11:16:28 -080056if with_gallium_radeonsi or with_amd_vk
57 subdir('amd')
58endif
Eric Anholt34cefa72018-07-29 19:22:33 -070059if with_gallium_vc4 or with_gallium_v3d
Eric Anholt1ae80182017-10-12 13:53:12 -070060 subdir('broadcom')
61endif
Dylan Baker49fa0742017-11-13 11:14:47 -080062if with_dri_i965 or with_intel_vk
63 subdir('intel')
64endif
Dylan Baker32180562017-09-20 20:11:32 -070065subdir('mesa')
Dylan Bakera47c5252017-09-22 12:55:00 -070066subdir('loader')
Alexander von Gluck IV834d2212018-02-16 16:56:31 -060067if with_platform_haiku
68 subdir('hgl')
69endif
70if with_glx != 'disabled'
71 subdir('glx')
72endif
Dylan Baker816bf7d12017-09-28 15:53:53 -070073if with_gbm
74 subdir('gbm')
Dylan Baker5fcadae2018-01-03 12:33:55 -080075else
76 inc_gbm = []
Dylan Baker816bf7d12017-09-28 15:53:53 -070077endif
Dylan Baker108d2572017-10-18 12:20:43 -070078if with_egl
79 subdir('egl')
80endif
Dylan Baker689fb742017-11-14 17:03:39 -080081if with_gallium
82 subdir('gallium')
Dylan Baker34cb4d02018-02-06 15:46:25 -080083 # This has to be here since it requires libgallium, and subdir cannot
84 # contain ..
Dylan Bakerc73abb42018-04-18 09:29:35 -070085 if with_tests
86 subdir('mesa/state_tracker/tests')
87 endif
Dylan Baker689fb742017-11-14 17:03:39 -080088endif
Dylan Baker13752af2017-11-02 16:51:40 -070089
90# This must be after at least mesa, glx, and gallium, since libgl will be
91# defined in one of those subdirs depending on the glx provider.
92if with_glx != 'disabled'
Dylan Bakerb9636fe2018-02-26 08:43:54 -080093 # If using glvnd the pkg-config header should not point to GL_mesa, it should
94 # point to GL. glvnd is only available on unix like platforms so adding -l
95 # should be safe here
96 # TODO: in the glvnd case glvnd itself should really be providing this.
97 if with_glvnd
98 _gl = '-L${libdir} -lGL'
99 else
100 _gl = libgl
101 endif
102
Dylan Baker13752af2017-11-02 16:51:40 -0700103 pkg.generate(
104 name : 'gl',
105 description : 'Mesa OpenGL Library',
106 version : meson.project_version(),
Dylan Baker5c460332018-02-20 10:36:44 -0800107 libraries : _gl,
Dylan Baker13752af2017-11-02 16:51:40 -0700108 libraries_private : gl_priv_libs,
109 requires_private : gl_priv_reqs,
110 variables : ['glx_tls=yes'],
111 )
112endif