|
| 1 | +# OpenXR™ Software Development Kit (SDK) Project |
| 2 | + |
| 3 | +This repository contains OpenXR headers, as well as source code and build scripts |
| 4 | +for the OpenXR loader. |
| 5 | +It contains all generated source files and headers pre-generated for minimum dependencies. |
| 6 | + |
| 7 | +The authoritative public repository for this project is located at |
| 8 | +<https://github.com/KhronosGroup/OpenXR-SDK>. |
| 9 | + |
| 10 | +The public repository containing the scripts that generate the files in this repository |
| 11 | +is located at |
| 12 | +<https://github.com/KhronosGroup/OpenXR-SDK-Source>. |
| 13 | +It hosts the public Issue tracker, and accepts patches (Pull Requests) from the |
| 14 | +general public. |
| 15 | +That repository is also where sample code (hello_xr) and API layer source can be found. |
| 16 | + |
| 17 | +**Note that this repo is effectively read-only: changes to this repo should be made in the [OpenXR-SDK-Source](https://github.com/KhronosGroup/OpenXR-SDK-Source) repo instead** |
| 18 | + |
| 19 | +## Directory Structure |
| 20 | + |
| 21 | +- `BUILDING.md` - Instructions for building the projects |
| 22 | +- `README.md` - This file |
| 23 | +- `COPYING.md` - Copyright and licensing information |
| 24 | +- `CODE_OF_CONDUCT.md` - Code of Conduct |
| 25 | +- `external/` - External code for projects in the repo |
| 26 | +- `include/` - OpenXR header files |
| 27 | +- `src/external/jsoncpp` - The jsoncpp project source code, an included dependency of the loader. |
| 28 | +- `src/loader` - OpenXR loader code, **including generated code** |
| 29 | + |
| 30 | +## Building |
| 31 | + |
| 32 | +The project is set up to build using CMake. |
| 33 | + |
| 34 | +### (Optional) Building the OpenXR Loader as a DLL |
| 35 | + |
| 36 | +By default, the OpenXR loader is built as a static library on Windows and a dynamic library on other platforms. |
| 37 | +To specify alternate behavior, define the CMake option `DYNAMIC_LOADER`, |
| 38 | +e.g. by adding `-DDYNAMIC_LOADER=ON` or `-DDYNAMIC_LOADER=OFF` to your CMake command line. |
| 39 | + |
| 40 | +### Windows |
| 41 | + |
| 42 | +Building the OpenXR components in this tree on Windows is supported using |
| 43 | +Visual Studio 2013 and newer. Before beginning, make sure the appropriate |
| 44 | +"msbuild.exe" is in your PATH. Also, when generating the solutions/projects |
| 45 | +using CMake, be sure to use the correct compiler version number. The |
| 46 | +following table is provided to help you: |
| 47 | + |
| 48 | +| Visual Studio | Version Number | |
| 49 | +| -------------------- |:--------------:| |
| 50 | +| Visual Studio 2013 | 12 | |
| 51 | +| Visual Studio 2015 | 14 | |
| 52 | +| Visual Studio 2017 | 15 | |
| 53 | + |
| 54 | +Specific sample command lines for building follow. |
| 55 | +If you're already familiar with the process of building a project with |
| 56 | +CMake, you may skim or skip these instructions. |
| 57 | + |
| 58 | +#### Windows 64-bit |
| 59 | + |
| 60 | +First, generate the 64-bit solution and project files using CMake: |
| 61 | + |
| 62 | +```cmd |
| 63 | +mkdir build\win64 |
| 64 | +cd build\win64 |
| 65 | +cmake -G "Visual Studio [Version Number] Win64" ..\.. |
| 66 | +``` |
| 67 | + |
| 68 | +Finally, open the `build\win64\OPENXR.sln` in the Visual Studio to build the loader. |
| 69 | + |
| 70 | +#### Windows 32-bit |
| 71 | + |
| 72 | +First, generate the 32-bit solution and project files using CMake: |
| 73 | + |
| 74 | +```cmd |
| 75 | +mkdir build\win32 |
| 76 | +cd build\win32 |
| 77 | +cmake -G "Visual Studio [Version Number]" ..\.. |
| 78 | +``` |
| 79 | + |
| 80 | +Open the `build\win32\OPENXR.sln` in the Visual Studio to build the loader. |
| 81 | + |
| 82 | +### Linux |
| 83 | + |
| 84 | +The following set of Debian/Ubuntu packages provides all required libs for building for xlib or xcb with OpenGL and Vulkan support. |
| 85 | + |
| 86 | +- `build-essential` |
| 87 | +- `cmake` (of _somewhat_ recent vintage, 3.10+ known working) |
| 88 | +- `libgl1-mesa-dev` |
| 89 | +- `libvulkan-dev` |
| 90 | +- `libx11-xcb-dev` |
| 91 | +- `libxcb-dri2-0-dev` |
| 92 | +- `libxcb-glx0-dev` |
| 93 | +- `libxcb-icccm4-dev` |
| 94 | +- `libxcb-keysyms1-dev` |
| 95 | +- `libxcb-randr0-dev` |
| 96 | +- `libxrandr-dev` |
| 97 | +- `libxxf86vm-dev` |
| 98 | +- `mesa-common-dev` |
| 99 | + |
| 100 | +Specific sample command lines for building follow. |
| 101 | +If you're already familiar with the process of building a project with |
| 102 | +CMake, you may skim or skip these instructions. |
| 103 | + |
| 104 | +#### Linux Debug |
| 105 | + |
| 106 | +```sh |
| 107 | +mkdir -p build/linux_debug |
| 108 | +cd build/linux_debug |
| 109 | +cmake -DCMAKE_BUILD_TYPE=Debug ../.. |
| 110 | +make |
| 111 | +``` |
| 112 | + |
| 113 | +#### Linux Release |
| 114 | + |
| 115 | +```sh |
| 116 | +mkdir -p build/linux_release |
| 117 | +cd build/linux_release |
| 118 | +cmake -DCMAKE_BUILD_TYPE=Release ../.. |
| 119 | +make |
| 120 | +``` |
0 commit comments