st/oxr: fix building on linux with OPENGL_GLX OFF

When building on linux and OPENGL_GLX OFF compilation fails with the
following error:

-----------------------------------------------------------------------
../../state_trackers/oxr/libst_oxr.a(oxr_session_gfx_gl.c.o): In function `oxr_session_populate_gl_xlib':
oxr_session_gfx_gl.c:(.text+0x5c): undefined reference to `xrt_gfx_provider_create_gl_xlib'
collect2: error: ld returned 1 exit status
src/xrt/targets/openxr/CMakeFiles/openxr_monado.dir/build.make:126: recipe for target 'src/xrt/targets/openxr/libopenxr_monado.so' failed
make[2]: *** [src/xrt/targets/openxr/libopenxr_monado.so] Error 1
CMakeFiles/Makefile2:2490: recipe for target 'src/xrt/targets/openxr/CMakeFiles/openxr_monado.dir/all' failed
make[1]: *** [src/xrt/targets/openxr/CMakeFiles/openxr_monado.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
-----------------------------------------------------------------------

Apparently the gl_xlib backend really depends on GLX specifically, so
fix the issue by reflecting that in the conditionally compiled blocks.
This commit is contained in:
Antonio Ospite 2021-11-12 18:27:08 +01:00 committed by Jakob Bornecrantz
parent 185bf61dd8
commit d20f8f4363
2 changed files with 3 additions and 3 deletions

View file

@ -907,7 +907,7 @@ oxr_xdev_get_hand_tracking_at(struct oxr_logger *log,
*
*/
#ifdef XR_USE_GRAPHICS_API_OPENGL
#ifdef XR_USE_GRAPHICS_API_OPENGL_GLX
#ifdef XR_USE_PLATFORM_XLIB
XrResult
@ -917,7 +917,7 @@ oxr_session_populate_gl_xlib(struct oxr_logger *log,
struct oxr_session *sess);
#endif // XR_USE_PLATFORM_XLIB
#endif // XR_USE_GRAPHICS_API_OPENGL
#endif // XR_USE_GRAPHICS_API_OPENGL_GLX
#if defined(XR_USE_GRAPHICS_API_OPENGL) || defined(XR_USE_GRAPHICS_API_OPENGL_ES)
XrResult

View file

@ -639,7 +639,7 @@ oxr_session_create_impl(struct oxr_logger *log,
const struct xrt_session_info *xsi,
struct oxr_session **out_session)
{
#if defined(XR_USE_PLATFORM_XLIB) && defined(XR_USE_GRAPHICS_API_OPENGL)
#if defined(XR_USE_PLATFORM_XLIB) && defined(XR_USE_GRAPHICS_API_OPENGL_GLX)
XrGraphicsBindingOpenGLXlibKHR const *opengl_xlib = OXR_GET_INPUT_FROM_CHAIN(
createInfo, XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR, XrGraphicsBindingOpenGLXlibKHR);
if (opengl_xlib != NULL) {