From da399c913448fd046e5170927ad7f2f8d5910a35 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Mon, 20 Jan 2025 15:41:30 +0100 Subject: [PATCH] meson: Add OHOS platform Signed-off-by: Christian Gmeiner --- meson.build | 11 ++++++++++- meson.options | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index f1b561b6ad5..3ab4b5ff0d9 100644 --- a/meson.build +++ b/meson.build @@ -334,7 +334,8 @@ if freedreno_kmds.length() != 0 and freedreno_kmds != [ 'msm' ] and with_freedre endif # This has to be below the freedreno_kmds check since that can change system_has_kms_drm -with_gallium_kmsro = with_gallium_drm or (system_has_kms_drm and with_gallium_zink) +# OHOS reports as 'linux' but has no libdrm, so exclude it from the zink+kmsro fallback. +with_gallium_kmsro = with_gallium_drm or (system_has_kms_drm and with_gallium_zink and not get_option('platforms').contains('ohos')) pre_args += ['-DMESA_SYSTEM_HAS_KMS_DRM=@0@'.format(system_has_kms_drm.to_int())] if host_machine.cpu_family() == 'x86' and with_glx_read_only_text @@ -482,6 +483,12 @@ with_platform_wayland = _platforms.contains('wayland') with_platform_haiku = _platforms.contains('haiku') with_platform_windows = _platforms.contains('windows') with_platform_macos = _platforms.contains('macos') +with_platform_ohos = _platforms.contains('ohos') + +if with_platform_ohos + pre_args += '-DVK_USE_PLATFORM_OHOS=1' + system_has_kms_drm = false +endif with_gfxstream_emulated_android = with_gfxstream_vk and with_platform_android and host_machine.system() == 'linux' if with_gfxstream_emulated_android @@ -510,6 +517,8 @@ if with_glx == 'auto' with_glx = 'disabled' elif with_platform_android with_glx = 'disabled' + elif with_platform_ohos + with_glx = 'disabled' elif with_dri with_glx = 'dri' elif with_platform_haiku diff --git a/meson.options b/meson.options index 024b8340252..3429a4c41e5 100644 --- a/meson.options +++ b/meson.options @@ -12,7 +12,7 @@ option( type : 'array', value : ['auto'], choices : [ - 'auto', 'x11', 'wayland', 'haiku', 'android', 'windows', 'macos', + 'auto', 'x11', 'wayland', 'haiku', 'android', 'windows', 'macos', 'ohos', ], description : 'window systems to support. If this is set to `auto`, all ' + 'platforms applicable will be enabled.' @@ -23,7 +23,7 @@ option( type : 'combo', value : 'auto', choices : [ - 'auto', 'x11', 'wayland', 'haiku', 'android', 'windows', + 'auto', 'x11', 'wayland', 'haiku', 'android', 'windows', 'ohos', 'surfaceless', 'drm', ], description : 'the window system EGL assumes for EGL_DEFAULT_DISPLAY',