meson: switch gles1 and gles2 to auto options
This allows them to default to false on windows, but default to true elsewhere. As a side effect turning off shared-glapi now automatically turns off gles. Shared glapi remains a boolean defaulting to true. v5: - new in this version Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
113bb8d448
commit
ddc15fba2b
32
meson.build
32
meson.build
|
@ -70,24 +70,42 @@ endif
|
|||
|
||||
with_gles1 = get_option('gles1')
|
||||
with_gles2 = get_option('gles2')
|
||||
if host_machine.system() == 'windows'
|
||||
if with_gles1 == 'auto'
|
||||
with_gles1 = 'false'
|
||||
endif
|
||||
if with_gles2 == 'auto'
|
||||
with_gles2 = 'false'
|
||||
endif
|
||||
endif
|
||||
with_opengl = get_option('opengl')
|
||||
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 = get_option('shared-glapi') and with_any_opengl
|
||||
|
||||
with_shared_glapi = get_option('shared-glapi')
|
||||
|
||||
# shared-glapi is required if at least two OpenGL APIs are being built
|
||||
if not with_shared_glapi
|
||||
if ((with_gles1 and with_gles2) or (with_gles1 and with_opengl)
|
||||
or (with_gles2 and with_opengl))
|
||||
if ((with_gles1 == 'true' and with_gles2 == 'true') or
|
||||
(with_gles1 == 'true' and with_opengl) or
|
||||
(with_gles2 == 'true' and with_opengl))
|
||||
error('shared-glapi required for building two or more of OpenGL, OpenGL ES 1.x, OpenGL ES 2.x')
|
||||
endif
|
||||
with_gles1 = 'false'
|
||||
with_gles2 = 'false'
|
||||
endif
|
||||
|
||||
# We require OpenGL for OpenGL ES
|
||||
if (with_gles1 or with_gles2) and not with_opengl
|
||||
if not with_opengl
|
||||
if (with_gles1 == 'true' or with_gles2 == 'true') and not with_opengl
|
||||
error('building OpenGL ES without OpenGL is not supported.')
|
||||
endif
|
||||
with_gles1 = 'false'
|
||||
with_gles2 = 'false'
|
||||
endif
|
||||
|
||||
with_gles1 = with_gles1 != 'false'
|
||||
with_gles2 = with_gles2 != 'false'
|
||||
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 = get_option('shared-glapi') and with_any_opengl
|
||||
|
||||
system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'dragonfly', 'linux'].contains(host_machine.system())
|
||||
|
||||
|
|
|
@ -181,14 +181,16 @@ option(
|
|||
)
|
||||
option(
|
||||
'gles1',
|
||||
type : 'boolean',
|
||||
value : true,
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['auto', 'true', 'false'],
|
||||
description : 'Build support for OpenGL ES 1.x'
|
||||
)
|
||||
option(
|
||||
'gles2',
|
||||
type : 'boolean',
|
||||
value : true,
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['auto', 'true', 'false'],
|
||||
description : 'Build support for OpenGL ES 2.x and 3.x'
|
||||
)
|
||||
option(
|
||||
|
|
Loading…
Reference in New Issue