summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorEric Engestrom <eric@engestrom.ch>2021-10-09 12:07:44 +0100
committerMarge Bot <emma+marge@anholt.net>2021-11-08 18:35:28 +0000
commitbee2c9c0819751ba6687008aeae36fcb9c3028d9 (patch)
tree39ea29938ba4aae0ebb42a6b2a947adbb1c75a7f /meson.build
parent5cc9c30aefdfc58f180d03e16af5ed38f8fb7ef0 (diff)
meson: automatically define `HAVE_{some}_PLATFORM`
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13278>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build22
1 files changed, 9 insertions, 13 deletions
diff --git a/meson.build b/meson.build
index b383ef7d46b..3aa9a6b4f9f 100644
--- a/meson.build
+++ b/meson.build
@@ -495,6 +495,14 @@ if with_egl and not _platforms.contains(egl_native_platform)
error('-Degl-native-platform does not specify an enabled platform')
endif
+if 'x11' in _platforms
+ _platforms += 'xcb'
+endif
+
+foreach platform : _platforms
+ pre_args += '-DHAVE_@0@_PLATFORM'.format(platform.to_upper())
+endforeach
+
# Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
use_elf_tls = false
if (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and
@@ -916,8 +924,6 @@ endif
gl_pkgconfig_c_flags = []
if with_platform_x11
- pre_args += '-DHAVE_X11_PLATFORM'
- pre_args += '-DHAVE_XCB_PLATFORM'
if with_glx == 'xlib' or with_glx == 'gallium-xlib'
pre_args += '-DUSE_XSHM'
else
@@ -937,12 +943,6 @@ else
pre_args += '-DEGL_NO_X11'
gl_pkgconfig_c_flags += '-DEGL_NO_X11'
endif
-if with_gbm and not with_platform_android
- pre_args += '-DHAVE_DRM_PLATFORM'
-endif
-if with_platform_windows
- pre_args += '-DHAVE_WINDOWS_PLATFORM'
-endif
with_android_stub = get_option('android-stub')
if with_android_stub and not with_platform_android
@@ -966,14 +966,10 @@ if with_platform_android
endif
endif
pre_args += [
- '-DHAVE_ANDROID_PLATFORM',
'-DANDROID',
'-DANDROID_API_LEVEL=' + get_option('platform-sdk-version').to_string()
]
endif
-if with_platform_haiku
- pre_args += '-DHAVE_HAIKU_PLATFORM'
-endif
prog_python = import('python').find_installation('python3')
has_mako = run_command(
@@ -1986,7 +1982,7 @@ if with_platform_wayland
dep_wl_protocols.get_pkgconfig_variable('pkgdatadir'), 'unstable',
'linux-dmabuf', 'linux-dmabuf-unstable-v1.xml'
)
- pre_args += ['-DHAVE_WAYLAND_PLATFORM', '-DWL_HIDE_DEPRECATED']
+ pre_args += '-DWL_HIDE_DEPRECATED'
endif
dep_x11 = null_dep