meson: don't build gallium subdir unless we're building gallium
[mesa.git] / src / meson.build
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
21 inc_common = include_directories(
22 '../include', '.', 'mapi', 'mesa', 'gallium/include', 'gallium/auxiliary')
23 inc_mesa = include_directories('mesa')
24 inc_mapi = include_directories('mapi')
25 inc_src = include_directories('.')
26 inc_gallium = include_directories('gallium/include')
27 inc_gallium_aux = include_directories('gallium/auxiliary')
28
29 libglsl_util = static_library(
30 'glsl_util',
31 files('mesa/main/extensions_table.c', 'mesa/main/imports.c',
32 'mesa/program/prog_parameter.c', 'mesa/program/symbol_table.c',
33 'mesa/program/dummy_errors.c'),
34 include_directories : [inc_common],
35 c_args : [c_vis_args],
36 build_by_default : false,
37 )
38
39 sha1_h = custom_target(
40 'git_sha1.h',
41 output : 'git_sha1.h',
42 command : [prog_python2, git_sha1_gen_py, '--output', '@OUTPUT@'],
43 build_always : true, # commit sha1 can change without having touched these files
44 )
45
46 subdir('gtest')
47 subdir('util')
48 subdir('mapi/glapi/gen')
49 subdir('mapi')
50 # TODO: opengl
51 subdir('compiler')
52 subdir('egl/wayland/wayland-drm')
53 subdir('vulkan')
54 if with_gallium_radeonsi or with_amd_vk
55 subdir('amd')
56 endif
57 if with_gallium_vc4
58 subdir('broadcom')
59 endif
60 if with_dri_i965 or with_intel_vk
61 subdir('intel')
62 endif
63 subdir('mesa')
64 subdir('loader')
65 subdir('glx')
66 if with_gbm
67 subdir('gbm')
68 endif
69 if with_egl
70 subdir('egl')
71 endif
72 if with_gallium
73 subdir('gallium')
74 endif
75
76 # This must be after at least mesa, glx, and gallium, since libgl will be
77 # defined in one of those subdirs depending on the glx provider.
78 if with_glx != 'disabled'
79 pkg.generate(
80 name : 'gl',
81 description : 'Mesa OpenGL Library',
82 version : meson.project_version(),
83 libraries : libgl,
84 libraries_private : gl_priv_libs,
85 requires_private : gl_priv_reqs,
86 variables : ['glx_tls=yes'],
87 )
88 endif