xref: /aosp_15_r20/external/mesa3d/src/glx/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2017-2019 Intel Corporation
2# SPDX-License-Identifier: MIT
3
4inc_glx = include_directories('.')
5
6subdir('apple')
7if with_dri_platform == 'windows'
8  subdir('windows')
9endif
10
11files_libglx = files(
12  'clientattrib.c',
13  'clientinfo.c',
14  'compsize.c',
15  'create_context.c',
16  'dri_common.c',
17  'dri_common.h',
18  'dri_common_query_renderer.c',
19  'drisw_glx.c',
20  'drisw_priv.h',
21  'eval.c',
22  'glxclient.h',
23  'glxcmds.c',
24  'glxconfig.c',
25  'glxconfig.h',
26  'glxcurrent.c',
27  'glx_error.c',
28  'glx_error.h',
29  'glxext.c',
30  'glxextensions.c',
31  'glxextensions.h',
32  'glxhash.c',
33  'glxhash.h',
34  'glx_pbuffer.c',
35  'glx_query.c',
36  'indirect_glx.c',
37  'indirect_init.h',
38  'indirect_texture_compression.c',
39  'indirect_transpose_matrix.c',
40  'indirect_vertex_array.c',
41  'indirect_vertex_array.h',
42  'indirect_vertex_array_priv.h',
43  'indirect_vertex_program.c',
44  'indirect_window_pos.c',
45  'packrender.h',
46  'packsingle.h',
47  'pixel.c',
48  'pixelstore.c',
49  'query_renderer.c',
50  'render2.c',
51  'renderpix.c',
52  'single2.c',
53  'singlepix.c',
54  'vertarr.c',
55  'xfont.c',
56)
57
58extra_libs_libglx = []
59extra_deps_libgl = []
60extra_ld_args_libgl = []
61
62# dri2
63if with_x11_dri2
64  files_libglx += files(
65    'dri2.c',
66    'dri2_glx.c',
67    'dri2.h',
68    'dri2_priv.h',
69  )
70endif
71
72if with_dri_platform == 'drm'
73  files_libglx += files('dri3_glx.c', 'dri3_priv.h')
74endif
75
76if with_dri_platform == 'apple'
77  files_libglx += files('applegl_glx.c')
78  extra_libs_libglx += libappleglx
79elif with_dri_platform == 'windows'
80  files_libglx += files('driwindows_glx.c')
81  extra_libs_libglx += [
82    libwindowsdri,
83    libwindowsglx,
84  ]
85  extra_deps_libgl = [
86    meson.get_compiler('c').find_library('gdi32'),
87    meson.get_compiler('c').find_library('opengl32')
88  ]
89  extra_ld_args_libgl = '-Wl,--disable-stdcall-fixup'
90endif
91
92if not with_glvnd
93  gl_lib_name = 'GL'
94  gl_lib_version = '1.2.0'
95else
96  gl_lib_name = 'GLX_@0@'.format(glvnd_vendor_name)
97  gl_lib_version = '0.0.0'
98  files_libglx += files(
99    'g_glxglvnddispatchfuncs.c',
100    'g_glxglvnddispatchindices.h',
101    'glxglvnd.c',
102    'glxglvnd.h',
103    'glxglvnddispatchfuncs.h',
104  )
105endif
106
107glx_gallium_link = [libpipe_loader_dynamic]
108if with_dri
109  glx_gallium_link += libgallium_dri
110endif
111if with_platform_windows
112  glx_gallium_link += libgallium_wgl
113endif
114libglx = static_library(
115  'glx',
116  [files_libglx, glx_generated],
117  include_directories : [inc_include, inc_src, inc_glapi, inc_loader, inc_loader_x11,
118                         inc_gallium, inc_mesa, inc_st_dri, inc_gallium_aux],
119  c_args : [
120    '-DGL_LIB_NAME="lib@[email protected].@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0]),
121  ],
122  gnu_symbol_visibility : 'hidden',
123  link_with : [
124    libloader, libloader_x11,
125    extra_libs_libglx, glx_gallium_link
126  ],
127  dependencies : [
128    idep_mesautil, idep_xmlconfig,
129    dep_libdrm, dep_dri2proto, dep_glproto, dep_x11, dep_xext, dep_glvnd, dep_xxf86vm, dep_xshmfence, dep_xfixes,
130  ],
131)
132
133libgl = shared_library(
134  gl_lib_name,
135  [],
136  link_with : [libglapi_static, libglapi],
137  link_whole : libglx,
138  link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl],
139  dependencies : [
140    dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, dep_xcb_glx, dep_xcb,
141    dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xxf86vm,
142    dep_xcb_shm, extra_deps_libgl,
143  ],
144  version : gl_lib_version,
145  darwin_versions : '4.0.0',
146  install : true,
147)
148