71ff82af38f8c9dabd273317ada2c8ad0ad48b1a
[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 = [inc_include, include_directories(
22 '.', '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 inc_amd_common = include_directories('amd/common')
29
30 libglsl_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
42 sha1_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
49 subdir('gtest')
50 if cc.get_id() == 'msvc'
51 subdir('getopt')
52 else
53 idep_getopt = null_dep
54 endif
55 subdir('util')
56 subdir('mapi')
57 # TODO: opengl
58 subdir('compiler')
59 if with_tools.contains('drm-shim')
60 subdir('drm-shim')
61 endif
62 subdir('imgui')
63 if with_platform_wayland
64 subdir('egl/wayland/wayland-drm')
65 endif
66 if with_any_vk
67 subdir('vulkan')
68 endif
69 if with_gallium_radeonsi or with_amd_vk
70 subdir('amd')
71 endif
72 if with_gallium_vc4 or with_gallium_v3d
73 subdir('broadcom')
74 endif
75 if with_gallium_etnaviv
76 subdir('etnaviv')
77 endif
78 if with_gallium_freedreno or with_freedreno_vk
79 subdir('freedreno')
80 endif
81 if with_gallium_panfrost or with_gallium_lima
82 subdir('panfrost')
83 endif
84 if with_dri_i965 or with_intel_vk or with_gallium_iris
85 subdir('intel')
86 endif
87 subdir('mesa')
88 subdir('loader')
89 if with_platform_haiku
90 subdir('hgl')
91 endif
92 if with_glx == 'dri'
93 subdir('glx')
94 endif
95 if with_gbm
96 subdir('gbm')
97 else
98 inc_gbm = []
99 endif
100 if with_egl
101 subdir('egl')
102 endif
103 if with_gallium
104 subdir('gallium')
105 # This has to be here since it requires libgallium, and subdir cannot
106 # contain ..
107 if with_tests and with_shared_glapi
108 subdir('mesa/state_tracker/tests')
109 endif
110 endif
111
112 # This must be after at least mesa, glx, and gallium, since libgl will be
113 # defined in one of those subdirs depending on the glx provider.
114 if with_glx != 'disabled'
115 # If using glvnd the pkg-config header should not point to GL_mesa, it should
116 # point to GL. glvnd is only available on unix like platforms so adding -l
117 # should be safe here
118 # TODO: in the glvnd case glvnd itself should really be providing this.
119 if with_glvnd
120 _gl = '-L${libdir} -lGL'
121 else
122 _gl = libgl
123 endif
124
125 pkg.generate(
126 name : 'gl',
127 description : 'Mesa OpenGL Library',
128 version : meson.project_version(),
129 libraries : _gl,
130 libraries_private : gl_priv_libs,
131 requires_private : gl_priv_reqs,
132 variables : ['glx_tls=yes'],
133 )
134 endif