Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello_xr is not aware of BSD #241

Open
yurivict opened this issue Feb 16, 2021 · 7 comments
Open

hello_xr is not aware of BSD #241

yurivict opened this issue Feb 16, 2021 · 7 comments
Labels
enhancement New feature or request synced to gitlab Synchronized to OpenXR internal GitLab

Comments

@yurivict
Copy link

Build fails with clang-10:

/usr/ports/misc/openxr/work/OpenXR-SDK-Source-release-1.0.14/src/common/gfxwrapper_opengl.c:38:31: error: unused parameter 'format' [-Werror,-Wunused-parameter]
static void Print(const char *format, ...) {
                              ^
@rpavlik-bot
Copy link
Collaborator

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.

@rpavlik-bot rpavlik-bot added the synced to gitlab Synchronized to OpenXR internal GitLab label Feb 18, 2021
@rpavlik
Copy link
Contributor

rpavlik commented Apr 2, 2021

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.

@rpavlik
Copy link
Contributor

rpavlik commented Apr 2, 2021

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.

@rpavlik rpavlik changed the title error: unused parameter 'format' [-Werror,-Wunused-parameter] hello_xr is not aware of BSD Apr 2, 2021
@rpavlik rpavlik added the enhancement New feature or request label Apr 2, 2021
@rpavlik
Copy link
Contributor

rpavlik commented Dec 11, 2023

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.

@msub2
Copy link

msub2 commented Dec 23, 2023

I managed to build successfully on FreeBSD 14 with OpenGL+X11. Only required changes were:

  • Adding a check for defined(__FreeBSD__) in src/gfxwrapper_opengl.h:130 (I imagine there's a more generic define that could work here for other variants)
  • Adding a check for CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" in src/CMakeLists.txt:245 to determine presentation backend
  • Adding /usr/local/include as a target include directory in each of the CMakeLists under src/tests

@VVD
Copy link

VVD commented Feb 27, 2024

My 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.

@VVD
Copy link

VVD commented Apr 16, 2024

ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request synced to gitlab Synchronized to OpenXR internal GitLab
Projects
None yet
Development

No branches or pull requests

5 participants