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
41 'main/eglfallbacks.c',
52 'main/eglentrypoint.h',
54 'drivers/dri2/egl_dri2.c',
55 'drivers/dri2/egl_dri2.h',
56 'drivers/dri2/egl_dri2_fallbacks.h',
59 linux_dmabuf_unstable_v1_protocol_c = custom_target(
60 'linux-dmabuf-unstable-v1-protocol.c',
61 input : wayland_dmabuf_xml,
62 output : 'linux-dmabuf-unstable-v1-protocol.c',
63 command : [prog_wl_scanner, 'code', '@INPUT@', '@OUTPUT@'],
66 linux_dmabuf_unstable_v1_client_protocol_h = custom_target(
67 'linux-dmabuf-unstable-v1-client-protocol.h',
68 input : wayland_dmabuf_xml,
69 output : 'linux-dmabuf-unstable-v1-client-protocol.h',
70 command : [prog_wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
74 files_egl += files('drivers/dri2/platform_x11.c')
76 files_egl += files('drivers/dri2/platform_x11_dri3.c')
77 link_for_egl += libloader_dri3_helper
79 deps_for_egl += [dep_xcb_dri2, dep_xcb_xfixes]
82 files_egl += files('drivers/dri2/platform_drm.c')
83 link_for_egl += libgbm
84 incs_for_egl += include_directories('../gbm/main')
86 if with_platform_surfaceless
87 files_egl += files('drivers/dri2/platform_surfaceless.c')
89 if with_platform_wayland
90 deps_for_egl += [dep_wayland_client, dep_wayland_server]
91 link_for_egl += libwayland_drm
92 files_egl += files('drivers/dri2/platform_wayland.c')
94 linux_dmabuf_unstable_v1_protocol_c,
95 linux_dmabuf_unstable_v1_client_protocol_h,
96 wayland_drm_client_protocol_h,
98 incs_for_egl += include_directories(
99 'wayland/wayland-egl', 'wayland/wayland-drm',
106 if cc.has_function('mincore')
107 c_args_for_egl += '-DHAVE_MINCORE'
110 libegl = shared_library(
116 '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir),
117 '-D_EGL_BUILT_IN_DRIVER_DRI2',
118 '-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_@0@'.format(egl_native_platform.to_upper()),
120 include_directories : [
121 incs_for_egl, inc_include, inc_src, inc_loader, inc_gbm,
122 include_directories('main'),
124 link_with : [link_for_egl, libloader, libxmlconfig, libglapi, libmesa_util],
125 link_args : [ld_args_bsymbolic, ld_args_gc_sections],
126 dependencies : [deps_for_egl, dep_dl, dep_libdrm, dep_clock, dep_thread],
133 description : 'Mesa EGL Library',
134 version : meson.project_version(),
136 libraries_private: gl_priv_libs,
137 requires_private : gl_priv_reqs,
138 extra_cflags : gl_pkgconfig_c_flags,
142 test('egl-symbols-check', find_program('egl-symbols-check'))
143 test('egl-entrypoint-check', find_program('egl-entrypoint-check'))