st/oxr: Check for compile definitions after includes

If the defines are set in a header instead of with the compiler, they need
to be checked after includes.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2194>
This commit is contained in:
Christoph Haag 2024-05-26 22:21:50 +02:00 committed by Marge Bot
parent 8f30fd137a
commit 8b2571b6ac
5 changed files with 28 additions and 28 deletions

View file

@ -9,10 +9,6 @@
* @ingroup comp_client
*/
#ifndef XR_USE_PLATFORM_EGL
#error "Must build this file with EGL enabled!"
#endif
#include <stdlib.h>
#include "util/u_misc.h"
@ -30,6 +26,10 @@
#include "xrt/xrt_gfx_egl.h"
#ifndef XR_USE_PLATFORM_EGL
#error "Must build this file with EGL enabled!"
#endif
// Not forward declared by mesa
typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYCONTEXTPROC)(EGLDisplay dpy,
EGLContext ctx,

View file

@ -9,14 +9,6 @@
* @ingroup comp_client
*/
#ifndef XR_USE_PLATFORM_WIN32
#error "Must build this file with Win32 enabled!"
#endif
#ifndef XR_USE_GRAPHICS_API_OPENGL
#error "Must build this file with OpenGL enabled!"
#endif
#include <stdlib.h>
#include "util/u_misc.h"
@ -30,6 +22,14 @@
#include "xrt/xrt_gfx_win32.h"
#ifndef XR_USE_PLATFORM_WIN32
#error "Must build this file with Win32 enabled!"
#endif
#ifndef XR_USE_GRAPHICS_API_OPENGL
#error "Must build this file with OpenGL enabled!"
#endif
XrResult
oxr_session_populate_gl_win32(struct oxr_logger *log,
struct oxr_system *sys,

View file

@ -8,14 +8,6 @@
* @ingroup comp_client
*/
#ifndef XR_USE_PLATFORM_XLIB
#error "Must build this file with XLIB enabled!"
#endif
#ifndef XR_USE_GRAPHICS_API_OPENGL
#error "Must build this file with OpenGL enabled!"
#endif
#include <stdlib.h>
#include "util/u_misc.h"
@ -29,6 +21,14 @@
#include "xrt/xrt_gfx_xlib.h"
#ifndef XR_USE_PLATFORM_XLIB
#error "Must build this file with XLIB enabled!"
#endif
#ifndef XR_USE_GRAPHICS_API_OPENGL
#error "Must build this file with OpenGL enabled!"
#endif
XrResult
oxr_session_populate_gl_xlib(struct oxr_logger *log,
struct oxr_system *sys,

View file

@ -10,10 +10,6 @@
* @ingroup comp_client
*/
#ifndef XR_USE_GRAPHICS_API_OPENGL_ES
#error "Must build this file with OpenGL ES enabled!"
#endif
#include <stdlib.h>
#include "util/u_misc.h"
@ -34,6 +30,10 @@
#include <dlfcn.h>
#ifndef XR_USE_GRAPHICS_API_OPENGL_ES
#error "Must build this file with OpenGL ES enabled!"
#endif
XrResult
oxr_session_populate_gles_android(struct oxr_logger *log,
struct oxr_system *sys,

View file

@ -8,10 +8,6 @@
* @ingroup comp_client
*/
#ifndef XR_USE_GRAPHICS_API_VULKAN
#error "Must build this file with Vulkan enabled!"
#endif
#include "xrt/xrt_instance.h"
#include "xrt/xrt_handles.h"
#include "xrt/xrt_gfx_vk.h"
@ -27,6 +23,10 @@
#include "oxr_handle.h"
#ifndef XR_USE_GRAPHICS_API_VULKAN
#error "Must build this file with Vulkan enabled!"
#endif
DEBUG_GET_ONCE_BOOL_OPTION(force_timeline_semaphores, "OXR_DEBUG_FORCE_TIMELINE_SEMAPHORES", false)
DEBUG_GET_ONCE_BOOL_OPTION(force_debug_utils, "OXR_DEBUG_FORCE_VK_DEBUG_UTILS", false)