Mesa (main): meson: automatically define `HAVE_{some}_PLATFORM`

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 8 19:01:10 UTC 2021


Module: Mesa
Branch: main
Commit: bee2c9c0819751ba6687008aeae36fcb9c3028d9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bee2c9c0819751ba6687008aeae36fcb9c3028d9

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Sat Oct  9 12:07:44 2021 +0100

meson: automatically define `HAVE_{some}_PLATFORM`

Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13278>

---

 meson.build | 22 +++++++++-------------
 1 file 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_ at 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



More information about the mesa-commit mailing list