1 # Copyright © 2017 Intel Corporation
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:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
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
25 inc_include, inc_src, inc_loader, inc_gbm, include_directories('main'),
43 'main/eglfallbacks.c',
54 'main/eglentrypoint.h',
56 'drivers/dri2/egl_dri2.c',
57 'drivers/dri2/egl_dri2.h',
58 'drivers/dri2/egl_dri2_fallbacks.h',
61 g_egldispatchstubs_c = custom_target(
62 'g_egldispatchstubs.c',
64 'generate/gen_egl_dispatch.py', 'generate/eglFunctionList.py',
65 'generate/egl.xml', 'generate/egl_other.xml'
67 output : 'g_egldispatchstubs.c',
69 prog_python2, '@INPUT0@', 'source', '@INPUT1@', '@INPUT2@', '@INPUT3@'
71 depend_files : files('generate/genCommon.py'),
75 g_egldispatchstubs_h = custom_target(
76 'g_egldispatchstubs.h',
78 'generate/gen_egl_dispatch.py', 'generate/eglFunctionList.py',
79 'generate/egl.xml', 'generate/egl_other.xml'
81 output : 'g_egldispatchstubs.h',
83 prog_python2, '@INPUT0@', 'header', '@INPUT1@', '@INPUT2@', '@INPUT3@'
85 depend_files : files('generate/genCommon.py'),
90 files_egl += files('drivers/dri2/platform_x11.c')
92 files_egl += files('drivers/dri2/platform_x11_dri3.c')
93 link_for_egl += libloader_dri3_helper
95 deps_for_egl += [dep_x11_xcb, dep_xcb_dri2, dep_xcb_xfixes]
98 files_egl += files('drivers/dri2/platform_drm.c')
99 link_for_egl += libgbm
100 incs_for_egl += include_directories('../gbm/main')
102 if with_platform_surfaceless
103 files_egl += files('drivers/dri2/platform_surfaceless.c')
105 if with_platform_wayland
106 deps_for_egl += [dep_wayland_client, dep_wayland_server]
107 link_for_egl += libwayland_drm
108 files_egl += files('drivers/dri2/platform_wayland.c')
110 linux_dmabuf_unstable_v1_protocol_c,
111 linux_dmabuf_unstable_v1_client_protocol_h,
112 wayland_drm_client_protocol_h,
114 incs_for_egl += include_directories(
115 'wayland/wayland-egl', 'wayland/wayland-drm',
118 if with_platform_android
119 deps_for_egl += dep_android
120 files_egl += files('drivers/dri2/platform_android.c')
125 if cc.has_function('mincore')
126 c_args_for_egl += '-DHAVE_MINCORE'
131 egl_lib_version = '1.0.0'
133 egl_lib_name = 'EGL_mesa'
134 egl_lib_version = '0.0.0'
135 files_egl += [g_egldispatchstubs_h, g_egldispatchstubs_c]
136 files_egl += files('main/eglglvnd.c', 'main/egldispatchstubs.c')
139 install_dir : join_paths(get_option('datadir'), 'glvnd', 'egl_vendor.d')
143 libegl = shared_library(
149 '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
150 '-D_EGL_BUILT_IN_DRIVER_DRI2',
151 '-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_@0@'.format(egl_native_platform.to_upper()),
153 include_directories : incs_for_egl,
154 link_with : [link_for_egl, libloader, libxmlconfig, libglapi, libmesa_util],
155 link_args : [ld_args_bsymbolic, ld_args_gc_sections],
156 dependencies : [deps_for_egl, dep_dl, dep_libdrm, dep_clock, dep_thread],
158 version : egl_lib_version,
163 description : 'Mesa EGL Library',
164 version : meson.project_version(),
166 libraries_private: gl_priv_libs,
167 requires_private : gl_priv_reqs,
168 extra_cflags : gl_pkgconfig_c_flags,
171 if with_platform_wayland
172 subdir('wayland/wayland-egl')
177 # TODO: add glvnd symbol check
179 test('egl-symbols-check',
180 find_program('egl-symbols-check'),
184 test('egl-entrypoint-check',
185 find_program('egl-entrypoint-check'),
186 env : [ 'srcdir=' + meson.current_source_dir() ]