Fix SDL dependency for Linux
I encountered some issues when trying to build OpenXR simple example with the SDL dependency. I'm not certain if these are specific to my installation of SDL, but I tried to find some official documentation where possible to support my changes. For additional context, I'm running on a fresh installation of Ubuntu 20.04.
Firstly, SDl is included as <SDL2/SDL.h>
, and the compiler is unable to find a file called begin_code.h
. It seems like the SDL developers recommend an alternative include, which also resolves the compiler issues for me.
Secondly, it seems like the CMake package defines SDL2_INCLUDE_DIRS
instead of SDL2_INCLUDE_DIR
. This seems to be documented in this SDL developer thread, and I can confirm that my /usr/lib/x86_64-linux-gnu/cmake/SDL2/sdl2-config.cmake
only defines the former variable.
I haven't tested these changes on Windows yet, but other members in the ILLIXR discord have reported having issues compiling on Linux.