meson: remove with_shared_glapi variable (it's always true)

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33794>
This commit is contained in:
Marek Olšák 2025-03-03 15:39:31 -05:00 committed by Marge Bot
parent fde53ac020
commit fefb1a6fb3
10 changed files with 16 additions and 66 deletions

View file

@ -119,26 +119,15 @@ if gbm_backends_path == ''
gbm_backends_path = join_paths(get_option('prefix'), get_option('libdir'), 'gbm')
endif
# TODO: Remove this and the old static glapi along with it.
with_shared_glapi = true
with_opengl = get_option('opengl')
with_gles1 = get_option('gles1') \
.require(with_shared_glapi, error_message : 'OpengGL ES 1.x requires shared-glapi') \
.allowed()
with_gles2 = get_option('gles2') \
.require(with_shared_glapi, error_message : 'OpengGL ES 2.x requires shared-glapi') \
.allowed()
with_gles1 = get_option('gles1').allowed()
with_gles2 = get_option('gles2').allowed()
pre_args += '-DHAVE_OPENGL=@0@'.format(with_opengl.to_int())
pre_args += '-DHAVE_OPENGL_ES_1=@0@'.format(with_gles1.to_int())
pre_args += '-DHAVE_OPENGL_ES_2=@0@'.format(with_gles2.to_int())
with_any_opengl = with_opengl or with_gles1 or with_gles2
# Only build shared_glapi if at least one OpenGL API is enabled
with_shared_glapi = with_shared_glapi and with_any_opengl
system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm'].contains(host_machine.system())
@ -473,7 +462,6 @@ if not (with_dri or with_gallium or with_glx != 'disabled')
with_gles2 = false
with_opengl = false
with_any_opengl = false
with_shared_glapi = false
endif
with_gbm = get_option('gbm') \
@ -487,7 +475,6 @@ with_xlib_lease = get_option('xlib-lease') \
with_egl = get_option('egl') \
.require(with_platform_windows or with_platform_haiku or with_dri or with_platform_android, error_message : 'EGL requires DRI, Haiku, Windows or Android') \
.require(with_shared_glapi, error_message : 'EGL requires shared-glapi') \
.require(with_glx != 'xlib', error_message :'EGL requires DRI, but GLX is being built with xlib support') \
.disable_auto_if(with_platform_haiku) \
.allowed()
@ -577,10 +564,6 @@ if with_glx != 'disabled'
elif with_dri
error('xlib conflicts with any dri driver')
endif
elif with_glx == 'dri'
if not with_shared_glapi
error('dri based GLX requires shared-glapi')
endif
endif
endif
@ -894,7 +877,7 @@ if with_platform_x11
endif
with_glapi_export_proto_entry_points = false
if with_shared_glapi and not with_glx_indirect_rendering
if not with_glx_indirect_rendering
# Imply !defined(GLX_INDIRECT_RENDERING)
with_glapi_export_proto_entry_points = true
endif
@ -2354,7 +2337,6 @@ summary(
'OpenGL': with_opengl,
'ES1': with_gles1,
'ES2': with_gles2,
'Shared glapi': with_shared_glapi,
'GLVND': with_glvnd,
},
section: 'OpenGL', bool_yn: true

View file

@ -2,11 +2,6 @@
# SPDX-License-Identifier: MIT
inc_wgl = include_directories('.')
_c_args_wgl = []
if not with_shared_glapi
# prevent _glapi_* from being declared __declspec(dllimport)
_c_args_wgl += '-D_GLAPI_NO_EXPORTS'
endif
_wgl_deps = [idep_xmlconfig, driver_zink, idep_mesautilformat]
if with_gallium_zink
@ -42,7 +37,6 @@ libwgl = static_library(
files_libwgl,
c_args : [
'-D_GDI32_', # prevent wgl* being declared __declspec(dllimport)
_c_args_wgl
],
include_directories : [
inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_mapi, inc_mesa,

View file

@ -50,9 +50,7 @@ if with_tests
wgl_test_env = environment()
wgl_test_env.append('PATH', libgallium_wgl_build_dir)
if with_shared_glapi
wgl_test_env.append('PATH', libglapi_build_dir)
endif
test(
'wgl',

View file

@ -6,16 +6,12 @@
# configure.ac)
gallium_xlib_ld_args = []
gallium_xlib_link_with = []
gallium_xlib_link_depends = []
if with_ld_version_script
gallium_xlib_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'libgl-xlib.sym')]
gallium_xlib_link_depends += files('libgl-xlib.sym')
endif
if with_shared_glapi
gallium_xlib_link_with += libglapi
endif
libgl = shared_library(
'GL',
@ -28,10 +24,7 @@ libgl = shared_library(
link_args : [ld_args_bsymbolic, ld_args_gc_sections, gallium_xlib_ld_args],
link_depends : gallium_xlib_link_depends,
link_whole : [libxlib, libglapi_bridge],
link_with : [
libgalliumvl_stub, libws_xlib, libglapi,
libgallium, libmesa, gallium_xlib_link_with,
],
link_with : [libgalliumvl_stub, libws_xlib, libglapi, libgallium, libmesa],
dependencies : [dep_x11, idep_mesautil, dep_thread, dep_clock, dep_unwind, driver_swrast, driver_virgl, driver_asahi],
install : true,
version : '1.5.0',

View file

@ -20,7 +20,7 @@ libgallium_wgl = shared_library(
],
link_whole : [libwgl],
link_with : [
libgallium, libglsl, libmesa, libwsgdi, (with_shared_glapi ? libglapi_bridge : libglapi_static), libglapi, libgalliumvl_stub,
libgallium, libglsl, libmesa, libwsgdi, libglapi_bridge, libglapi, libgalliumvl_stub,
],
dependencies : [
dep_ws2_32, idep_nir, idep_mesautil, driver_swrast,

View file

@ -130,13 +130,9 @@ libglx = static_library(
],
)
if with_shared_glapi
# libglapi_bridge contains GL functions that we need to export from libGL.so.
# Other than that, we don't need it.
libgl_link = with_glvnd ? [] : [libglapi_bridge]
else
libgl_link = libglapi_static
endif
libgl = shared_library(
gl_lib_name,

View file

@ -67,7 +67,7 @@ libglapi_bridge = static_library(
build_by_default : false,
)
if not with_shared_glapi
if false
libglapi_static = static_library(
'glapi_static',
static_glapi_files,

View file

@ -147,8 +147,4 @@ glapi_xml_py_deps = files(
)
subdir('glapi')
if with_shared_glapi
subdir('shared-glapi')
else
libglapi = []
endif

View file

@ -4,21 +4,12 @@
files_main_test = files(
'enum_strings.cpp',
'disable_windows_include.c',
)
# disable_windows_include.c includes this generated header.
files_main_test += main_marshal_generated_h
link_main_test = []
if with_shared_glapi
files_main_test += files(
'mesa_formats.cpp',
'mesa_extensions.cpp',
'program_state_string.cpp',
)
link_main_test += libglapi
else
files_main_test += files('stubs.cpp')
endif
# disable_windows_include.c includes this generated header.
files_main_test += main_marshal_generated_h
test(
'main-test',
@ -27,7 +18,7 @@ test(
[files_main_test, main_dispatch_h],
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [idep_gtest, dep_clock, dep_dl, dep_thread, idep_nir_headers, idep_mesautil],
link_with : [libmesa, libgallium, link_main_test],
link_with : [libmesa, libgallium, libglapi],
),
suite : ['mesa'],
protocol : 'gtest',

View file

@ -119,7 +119,7 @@ if with_gallium and (with_glx != 'disabled' or with_egl)
if with_gles2 and not with_glvnd
subdir('mapi/es2api')
endif
if with_tests and with_shared_glapi
if with_tests
subdir('mesa/main/tests')
subdir('mesa/state_tracker/tests')
endif