meson.build revision 01e04c3f
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_common = include_directories(
22  '../include', '.', 'mapi', 'mesa', 'gallium/include', 'gallium/auxiliary')
23inc_mesa = include_directories('mesa')
24inc_mapi = include_directories('mapi')
25inc_src = include_directories('.')
26inc_gallium = include_directories('gallium/include')
27inc_gallium_aux = include_directories('gallium/auxiliary')
28inc_amd_common = include_directories('amd/common')
29
30libglsl_util = static_library(
31  'glsl_util',
32  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  ),
37  include_directories : [inc_common],
38  c_args : [c_vis_args],
39  build_by_default : false,
40)
41
42sha1_h = custom_target(
43  'git_sha1.h',
44  output : 'git_sha1.h',
45  command : [prog_python, git_sha1_gen_py, '--output', '@OUTPUT@'],
46  build_always : true, # commit sha1 can change without having touched these files
47)
48
49subdir('gtest')
50subdir('util')
51subdir('mapi')
52# TODO: opengl
53subdir('compiler')
54if with_platform_wayland
55  subdir('egl/wayland/wayland-drm')
56endif
57if with_any_vk
58  subdir('vulkan')
59endif
60if with_gallium_radeonsi or with_amd_vk
61  subdir('amd')
62endif
63if with_gallium_vc4 or with_gallium_v3d
64  subdir('broadcom')
65endif
66if with_dri_i965 or with_intel_vk
67  subdir('intel')
68endif
69subdir('mesa')
70subdir('loader')
71if with_platform_haiku
72  subdir('hgl')
73endif
74if with_glx == 'dri'
75  subdir('glx')
76endif
77if with_gbm
78  subdir('gbm')
79else
80  inc_gbm = []
81endif
82if with_egl
83  subdir('egl')
84endif
85if with_gallium
86  subdir('gallium')
87  # This has to be here since it requires libgallium, and subdir cannot
88  # contain ..
89  if with_tests and with_shared_glapi
90    subdir('mesa/state_tracker/tests')
91  endif
92endif
93
94# This must be after at least mesa, glx, and gallium, since libgl will be
95# defined in one of those subdirs depending on the glx provider.
96if with_glx != 'disabled'
97  # If using glvnd the pkg-config header should not point to GL_mesa, it should
98  # point to GL. glvnd is only available on unix like platforms so adding -l
99  # should be safe here
100  # TODO: in the glvnd case glvnd itself should really be providing this.
101  if with_glvnd
102    _gl = '-L${libdir} -lGL'
103  else
104    _gl = libgl
105  endif
106
107  pkg.generate(
108    name : 'gl',
109    description : 'Mesa OpenGL Library',
110    version : meson.project_version(),
111    libraries : _gl,
112    libraries_private : gl_priv_libs,
113    requires_private : gl_priv_reqs,
114    variables : ['glx_tls=yes'],
115  )
116endif
117