Browse Source

Merge pull request #98589 from juanjp600/openxr-no-wayland-build-fix

Fix OpenXR module failing to build on Linux when Wayland is disabled
Thaddeus Crews 9 months ago
parent
commit
23f03a7cce

+ 2 - 2
modules/openxr/extensions/platform/openxr_opengl_extension.cpp

@@ -64,7 +64,7 @@ HashMap<String, bool *> OpenXROpenGLExtension::get_requested_extensions() {
 #else
 #else
 	request_extensions[XR_KHR_OPENGL_ENABLE_EXTENSION_NAME] = nullptr;
 	request_extensions[XR_KHR_OPENGL_ENABLE_EXTENSION_NAME] = nullptr;
 #endif
 #endif
-#if defined(LINUXBSD_ENABLED) && defined(EGL_ENABLED)
+#if defined(LINUXBSD_ENABLED) && defined(EGL_ENABLED) && defined(WAYLAND_ENABLED)
 	request_extensions[XR_MNDX_EGL_ENABLE_EXTENSION_NAME] = &egl_extension_enabled;
 	request_extensions[XR_MNDX_EGL_ENABLE_EXTENSION_NAME] = &egl_extension_enabled;
 #endif
 #endif
 
 
@@ -135,7 +135,7 @@ XrGraphicsBindingOpenGLESAndroidKHR OpenXROpenGLExtension::graphics_binding_gl;
 #ifdef X11_ENABLED
 #ifdef X11_ENABLED
 XrGraphicsBindingOpenGLXlibKHR OpenXROpenGLExtension::graphics_binding_gl;
 XrGraphicsBindingOpenGLXlibKHR OpenXROpenGLExtension::graphics_binding_gl;
 #endif
 #endif
-#ifdef EGL_ENABLED
+#if defined(EGL_ENABLED) && defined(WAYLAND_ENABLED)
 XrGraphicsBindingEGLMNDX OpenXROpenGLExtension::graphics_binding_egl;
 XrGraphicsBindingEGLMNDX OpenXROpenGLExtension::graphics_binding_egl;
 #endif
 #endif
 #endif
 #endif

+ 1 - 1
modules/openxr/extensions/platform/openxr_opengl_extension.h

@@ -68,7 +68,7 @@ private:
 #ifdef X11_ENABLED
 #ifdef X11_ENABLED
 	static XrGraphicsBindingOpenGLXlibKHR graphics_binding_gl;
 	static XrGraphicsBindingOpenGLXlibKHR graphics_binding_gl;
 #endif
 #endif
-#ifdef EGL_ENABLED
+#if defined(EGL_ENABLED) && defined(WAYLAND_ENABLED)
 	static XrGraphicsBindingEGLMNDX graphics_binding_egl;
 	static XrGraphicsBindingEGLMNDX graphics_binding_egl;
 
 
 	bool egl_extension_enabled = false;
 	bool egl_extension_enabled = false;