Open yurivict opened 3 years ago
An issue (number 1523) has been filed to correspond to this issue in the internal Khronos GitLab (Khronos members only: KHR:openxr/openxr#1523 ), to facilitate working group processes.
This GitHub issue will continue to be the main site of discussion.
Ah, I assume this isn't the only error you're seeing, since it means that you are missing an OS define for that file. I'm guessing you're on a BSD based on the source path? I suspect the OS_LINUX defines will actually get you what you want here, so if you can confirm that (e.g. adding -DOS_LINUX to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS) we can adjust the build system accordingly. I think most of the stuff labeled "Linux" is actually just Posix.
Yeah, it actually looks like all the utils and such from Facebook/Oculus that are used mainly in hello_xr are unaware of BSD and will need ports: see external/include/utils in addition to gfxwrapper. Hopefully the ports aren't too hard.
FWIW, the platform plugins have been renamed, though there is still an OS_LINUX define in gfxwrapper.
This should not be an impediment to getting the loader to build, however.
I managed to build successfully on FreeBSD 14 with OpenGL+X11. Only required changes were:
defined(__FreeBSD__)
in src/gfxwrapper_opengl.h:130 (I imagine there's a more generic define that could work here for other variants)CMAKE_SYSTEM_NAME STREQUAL "FreeBSD"
in src/CMakeLists.txt:245 to determine presentation backend/usr/local/include
as a target include directory in each of the CMakeLists under src/testsMy patch for build https://github.com/KhronosGroup/OpenXR-SDK is:
--- src/CMakeLists.txt.orig 2024-02-17 20:48:29 UTC
+++ src/CMakeLists.txt
@@ -165,7 +165,7 @@ cmake_dependent_option(
if(WIN32)
add_definitions(-DXR_OS_WINDOWS)
add_definitions(-DNOMINMAX)
-elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
add_definitions(-DXR_OS_LINUX)
elseif(ANDROID)
add_definitions(-DXR_OS_ANDROID)
It's hack.
Correct patch must define -DXR_OS_FREEBSD
and add defined(XR_OS_FREEBSD)
to all #if defined(XR_OS_LINUX)
/#ifdef XR_OS_LINUX
lines in sources. Or replace XR_OS_LINUX
with XR_OS_POSIX
as suggester above.
ping
Build fails with clang-10: