Merge commit 'a896d798538e696539bd3ba61c5b726b11542382' into debian/bullseye

This commit is contained in:
Rylie Pavlik 2024-05-03 11:51:33 -05:00
commit f691c3f2c9
2077 changed files with 225113 additions and 38814 deletions

View file

@ -1,24 +1,40 @@
---
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2020 Collabora, Ltd. and the Monado contributors
# Ideally we'd turn back on a few of these that are disabled near the end
Checks: 'clang-diagnostic-*,
clang-analyzer-*,
performance-*,
bugprone-*,
cert-*,
readability-*,
misc-*,
-modernize-*,
-clang-analyzer-security.insecureAPI.strcpy,
-bugprone-macro-parentheses,
-readability-braces-around-statements,
-misc-unused-parameters,
-readability-implicit-bool-conversion,
-clang-diagnostic-missing-field-initializers,
-clang-diagnostic-missing-braces,
-readability-uppercase-literal-suffix,
-misc-non-private-member-variables-in-classes'
# SPDX-FileCopyrightText: 2018-2023, Collabora, Ltd. and the Monado contributors
# Ideally we'd turn back on some of these that are disabled.
# Things on the same line are synonyms
Checks: |
clang-diagnostic-*,
clang-analyzer-*,
hicpp-signed-bitwise,
performance-*,
bugprone-*,
cert-*,
readability-*,
misc-*,
-modernize-*,
-bugprone-macro-parentheses,
-bugprone-reserved-identifier,-cert-dcl37-c,-cert-dcl51-cpp,
-cert-dcl21-cpp,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-clang-analyzer-security.insecureAPI.strcpy,
-clang-diagnostic-missing-braces,
-clang-diagnostic-missing-field-initializers,
-clang-diagnostic-unused-function,
-misc-non-private-member-variables-in-classes,
-misc-static-assert,-cert-dcl03-c,
-misc-unused-using-decls,
-misc-unused-parameters,
-performance-no-int-to-ptr,
-readability-braces-around-statements,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-redundant-access-specifiers,
-readability-uppercase-literal-suffix,-hicpp-uppercase-literal-suffix,
# Notes:
# misc-static-assert turns our assert(false) in failure/bad cases into static_asserts. We should revise them, but not like that.
# cert-dcl21-cpp is an overkill "recommendation" to return a special type from iterator post-increment
WarningsAsErrors: ''
HeaderFilterRegex: 'src/xrt/.*'
AnalyzeTemporaryDtors: false

48
.cmake-format.py Normal file
View file

@ -0,0 +1,48 @@
# SPDX-FileCopyrightText: 2021-2022, Collabora, Ltd.
# SPDX-License-Identifier: CC0-1.0
with section("parse"):
# Specify structure for custom cmake functions
additional_commands = {
"generate_openxr_runtime_manifest_at_install": {
"kwargs": {
"DESTINATION": 1,
"MANIFEST_TEMPLATE": 1,
"OUT_FILENAME": 1,
"RELATIVE_RUNTIME_DIR": 1,
"RUNTIME_DIR_RELATIVE_TO_MANIFEST": 1,
"RUNTIME_TARGET": 1,
},
"pargs": {"flags": ["ABSOLUTE_RUNTIME_PATH"], "nargs": "*"},
},
"generate_openxr_runtime_manifest_buildtree": {
"kwargs": {"MANIFEST_TEMPLATE": 1, "OUT_FILE": 1, "RUNTIME_TARGET": 1},
"pargs": {"flags": [], "nargs": "*"},
},
"option_with_deps": {
"kwargs": {"DEFAULT": 1, "DEPENDS": "+"},
"pargs": {"flags": [], "nargs": "2+"},
},
}
with section("format"):
line_width = 100
tab_size = 8
use_tabchars = True
fractional_tab_policy = "use-space"
max_prefix_chars = 4
dangle_parens = True
dangle_align = "prefix-indent"
max_pargs_hwrap = 4
max_rows_cmdline = 1
keyword_case = "upper"
# Do not reflow comments
with section("markup"):
enable_markup = False

16
.git-blame-ignore-revs Normal file
View file

@ -0,0 +1,16 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2023, Collabora, Ltd. and the Monado contributors
# Use with `git config --local blame.ignoreRevsFile .git-blame-ignore-revs`
# Apply spotless 6.22 and google-java-format 1.18.1
30ebd2fe1bb28f7c7247bf2203801267f137d4f6
# Re-order IPC functions.
fc356393c2c1e006d1692ced87e3677c4859c10e
c6b14de7f8be9622bd54db7784794bed1a90aa52
# Format changes
2b996f30c43ca5b0f25d252539297f882c691e65
ae6ac5fc0e669b71a3614b7507536c39c5f188a2
360dbb63a749e094314d0a41337a27ed2d3c8e60

19
.gitignore vendored
View file

@ -25,6 +25,7 @@ src/xrt/compositor/shaders/*.vert.h
src/xrt/compositor/shaders/*.frag.h
src/xrt/compositor/shaders/*.comp.h
src/xrt/include/xrt/xrt_config_*.h
!src/xrt/include/xrt/xrt_config_*os.h
src/xrt/ipc/*_generated.*
src/xrt/targets/cli/monado-cli
src/xrt/targets/ctl/monado-ctl
@ -44,12 +45,14 @@ __pycache__/
# Ignore build trees
build/
build*/
cmake-build-*/
# Ignore local settings
.vscode
*.autosave
.vs
CMakeSettings.json
CMakeUserPresets.json
# Ignore merge-conflict resolution files
*.orig
@ -74,7 +77,7 @@ src/xrt/drivers/arduino/device/*.bin
# Ignore gradle-related and android studio-related things
*.iml
.gradle/
local.properties
/local.properties
.idea/*
# .idea/caches
# .idea/libraries
@ -87,10 +90,7 @@ local.properties
.settings
.project
.classpath
gradlew
gradlew.bat
gradle-wrapper.jar
*.hprof
# Ignore Sourcetrail things
*.srctrlbm
@ -99,3 +99,12 @@ gradle-wrapper.jar
# Ignore clangd things
.cache/
# Ignore CI things
container-build-report.xml
# Ignore Vulkan validation layer settings
vk_layer_settings.txt
# Ignore local pyenv version file
.python-version

View file

@ -1,69 +1,32 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2021 Collabora, Ltd. and the Monado contributors
# SPDX-FileCopyrightText: 2018-2023 Collabora, Ltd. and the Monado contributors
###############################################
# GENERATED - DO NOT EDIT
# see .gitlab-ci/ci.template, etc instead
###############################################
# workflow:
# rules:
# - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
# - if: $CI_PIPELINE_SOURCE == 'push'
variables:
FDO_UPSTREAM_REPO: monado/monado
.templates_sha: &templates_sha db8eb22cd1abb036560faaebd36a38565a3ebda2
# Variables listing packages for Debian-based distros
.monado.variables.debian-based-packages:
variables:
# Packages required for build and some other basic jobs
CORE_REQUIRED_PACKAGES: "build-essential git wget unzip cmake meson ninja-build libeigen3-dev curl patch python3 pkg-config libx11-dev libx11-xcb-dev libxxf86vm-dev libxrandr-dev libxcb-randr0-dev libvulkan-dev glslang-tools libglvnd-dev libgl1-mesa-dev ca-certificates libusb-1.0-0-dev libudev-dev"
# These are optional packages, that we're building against to ensure we build as much code as possible
FEATURE_PACKAGES: "libhidapi-dev libwayland-dev libuvc-dev libavcodec-dev libopencv-dev libv4l-dev libcjson-dev libsdl2-dev libegl1-mesa-dev libdbus-1-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libsystemd-dev libbsd-dev"
# Only used for building packages
PACKAGING_PACKAGES: "devscripts debhelper dput-ng gettext-base markdown doxygen graphviz"
# Used for ancillary "not compilation" jobs/features, like docs, changelogs, formatting, etc.
TOOLS_REQUIRED_PACKAGES: "clang-format-7 codespell doxygen graphviz python3-pip python3-click"
# The NDK builder uses only these packages
NDK_PACKAGES: "git wget unzip cmake meson ninja-build libeigen3-dev python3 pkg-config ca-certificates glslang-tools"
# Variables for build and usage of Debian 10 (Buster) image
.monado.variables.debian:buster:
variables:
FDO_DISTRIBUTION_VERSION: buster
FDO_DISTRIBUTION_TAG: "2021-04-15.0"
# Variables for build and usage of Ubuntu 20.04 LTS (Focal) image
.monado.variables.ubuntu:focal:
variables:
FDO_DISTRIBUTION_VERSION: "20.04"
FDO_DISTRIBUTION_TAG: "2021-04-15.0"
# Variables for build and usage of Ubuntu 20.10 (Groovy) image
.monado.variables.ubuntu:groovy:
variables:
FDO_DISTRIBUTION_VERSION: "20.10"
FDO_DISTRIBUTION_TAG: "2021-04-15.0"
# Variables for build and usage of Debian 10 (Buster) + Android NDK image
.monado.variables.debian:buster-ndk:
variables:
FDO_DISTRIBUTION_VERSION: buster
FDO_DISTRIBUTION_TAG: "2020-05-06.0"
FDO_REPO_SUFFIX: ndk
# Variables for build and usage of Arch Linux image
.monado.variables.arch:rolling:
variables:
FDO_DISTRIBUTION_TAG: "2021-09-14.0"
FDO_UPSTREAM_REPO: "monado/monado"
include:
- project: "freedesktop/ci-templates"
ref: *templates_sha
file: "/templates/debian.yml"
- project: "freedesktop/ci-templates"
ref: *templates_sha
file: "/templates/ubuntu.yml"
- project: "freedesktop/ci-templates"
ref: *templates_sha
file: "/templates/arch.yml"
ref: 185ede0e9b9b1924b92306ab8b882a6294e92613
file:
- "/templates/debian.yml"
- "/templates/ubuntu.yml"
- "/templates/arch.yml"
- "/templates/alpine.yml"
# - local: .gitlab-ci/containers/ci-container-prep.yml
# This include is for compatibility with the fdo CI restrictions/checks
# needed due to https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/438
- local: .gitlab-ci/ci-rules.yml
stages:
- container_prep
@ -73,83 +36,261 @@ stages:
- pages
- deploy
###
# Extra rules for packaging
.monado.packaging.conditions:
rules:
# Only the default branch of the "upstream" repo.
- if: "$CI_PROJECT_PATH == $FDO_UPSTREAM_REPO && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
when: on_success
# Otherwise, don't build packages.
- when: never
###
###
# Windows container-related jobs (prep and usage)
.monado.common_variables.windows:vs2022:
inherit:
default: false
variables:
MONADO_WIN_BASE_TAG: "20230422.0"
MONADO_WIN_MAIN_TAG: "20230422.0"
MONADO_BASE_IMAGE_PATH: "win2022/vs2022_base"
MONADO_MAIN_IMAGE_PATH: "win2022/vs2022"
.monado.variables.windows:vs2022:
inherit:
default: false
extends:
- .monado.common_variables.windows:vs2022
variables:
MONADO_IMAGE_PATH: "$MONADO_MAIN_IMAGE_PATH"
FDO_DISTRIBUTION_TAG: "$MONADO_WIN_MAIN_TAG"
MONADO_IMAGE: "$CI_REGISTRY_IMAGE/$MONADO_IMAGE_PATH:$FDO_DISTRIBUTION_TAG"
MONADO_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MONADO_IMAGE_PATH:$FDO_DISTRIBUTION_TAG"
# Shared container-building job
.monado.windows.container_prep:
inherit:
default: false
tags:
- windows
- "2022"
- shell
variables:
GIT_STRATEGY: fetch
extends:
- .container-rules
stage: container_prep
script:
- |
.gitlab-ci\windows\monado_container.ps1 -RegistryUri "$CI_REGISTRY" -RegistryUsername "$CI_REGISTRY_USER" -UserImage "$MONADO_IMAGE" -UpstreamImage "$MONADO_UPSTREAM_IMAGE" -Dockerfile "$DOCKERFILE" -BaseImage "$MONADO_BASE_IMAGE" -BaseUpstreamImage "$MONADO_UPSTREAM_BASE_IMAGE" -Verbose
# This container just installs Visual C++ Build Tools.
win:container_prep:base:
extends:
- .monado.windows.container_prep
- .monado.common_variables.windows:vs2022
variables:
DOCKERFILE: Dockerfile.vs2022
MONADO_IMAGE_PATH: ${MONADO_BASE_IMAGE_PATH}
FDO_DISTRIBUTION_TAG: "$MONADO_WIN_BASE_TAG"
MONADO_IMAGE: "$CI_REGISTRY_IMAGE/$MONADO_IMAGE_PATH:$FDO_DISTRIBUTION_TAG"
MONADO_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MONADO_IMAGE_PATH:$FDO_DISTRIBUTION_TAG"
# This container adds other deps
win:container_prep:
extends:
- .monado.windows.container_prep
- .monado.variables.windows:vs2022
needs:
- win:container_prep:base
variables:
DOCKERFILE: Dockerfile.build
MONADO_BASE_IMAGE: "$CI_REGISTRY_IMAGE/$MONADO_BASE_IMAGE_PATH:$MONADO_WIN_BASE_TAG"
MONADO_UPSTREAM_BASE_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MONADO_BASE_IMAGE_PATH:$MONADO_WIN_BASE_TAG"
# Base job to use a Windows build container
.monado.image.windows:
tags:
- windows
- "2022"
- docker
extends:
- .monado.variables.windows:vs2022
- .build-rules
image: $MONADO_IMAGE
# Variables for build and usage of Debian bullseye image
.monado.variables.debian:bullseye:
variables:
FDO_DISTRIBUTION_VERSION: "bullseye"
FDO_DISTRIBUTION_TAG: "2024-01-16"
# Variables for build and usage of Debian bookworm-ndk image
.monado.variables.debian:bookworm-ndk:
variables:
FDO_DISTRIBUTION_VERSION: "bookworm"
FDO_DISTRIBUTION_TAG: "2024-01-16"
FDO_REPO_SUFFIX: ndk
# Variables for build and usage of Ubuntu focal image
.monado.variables.ubuntu:focal:
variables:
FDO_DISTRIBUTION_VERSION: "20.04"
FDO_DISTRIBUTION_TAG: "2024-01-16"
# Variables for build and usage of Ubuntu jammy image
.monado.variables.ubuntu:jammy:
variables:
FDO_DISTRIBUTION_VERSION: "22.04"
FDO_DISTRIBUTION_TAG: "2024-01-16"
# Variables for build and usage of Arch image
.monado.variables.arch:
variables:
FDO_DISTRIBUTION_TAG: "2024-01-16"
# Variables for build and usage of Alpine image
.monado.variables.alpine:
variables:
FDO_DISTRIBUTION_TAG: "2024-01-16"
###
# Container prep jobs
# Base for all container prep
.monado.variables.container-prep-base:
# "stage" set here doesn't work, for some reason
variables:
# no need to pull the whole tree for rebuilding the image - is this still needed?
GIT_STRATEGY: none
# Each most-derived container prep job has a script to set up stuff for it.
FDO_DISTRIBUTION_EXEC: "bash .gitlab-ci/$(echo ${CI_JOB_NAME} | sed 's/:/_/g').sh"
# Debian Buster (x64 + i386)
debian:container_prep:
# Make Debian bullseye image
debian:bullseye:container_prep:
stage: container_prep
extends:
- .monado.variables.debian:buster
- .monado.variables.container-prep-base
- .monado.variables.debian-based-packages
- .container-rules
- .monado.variables.debian:bullseye
- .fdo.container-build@debian # from ci-templates
variables:
# a list of packages to install - assembled from .monado.variables.debian-based-packages, plus reprepro
FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES} ${TOOLS_REQUIRED_PACKAGES} reprepro"
# Arch Linux (x64)
arch:container_prep:
variables:
FDO_DISTRIBUTION_PACKAGES: 'build-essential ca-certificates clang-format cmake codespell curl debhelper devscripts doxygen dput-ng gettext-base git glslang-tools graphviz libbluetooth-dev libbsd-dev libcjson-dev libdbus-1-dev libegl1-mesa-dev libeigen3-dev libgl1-mesa-dev libglvnd-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libhidapi-dev libopencv-dev libsdl2-dev libsystemd-dev libudev-dev libusb-1.0-0-dev libuvc-dev libv4l-dev libvulkan-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev ninja-build pandoc patch pkg-config python3 python3-click python3-pip unzip wget'
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/i386_and_proclamation_container_prep.sh'
# Make Debian bookworm-ndk image
debian:bookworm-ndk:container_prep:
stage: container_prep
extends:
- .monado.variables.arch:rolling
- .monado.variables.container-prep-base
- .fdo.container-build@arch # from ci-templates
variables:
# a list of packages to install
FDO_DISTRIBUTION_PACKAGES: "git gcc clang cmake meson ninja pkgconfig python3 diffutils patch doxygen graphviz eigen hidapi libxrandr mesa glslang vulkan-headers vulkan-icd-loader check glfw-x11 libusb opencv gtk3 ffmpeg v4l-utils qt5-base"
- .container-rules
- .monado.variables.debian:bookworm-ndk
- .fdo.container-build@debian # from ci-templates
# Ubuntu Focal (x64)
variables:
FDO_DISTRIBUTION_PACKAGES: 'ca-certificates cmake default-jdk-headless git glslang-tools libeigen3-dev meson ninja-build pkg-config python3 unzip wget'
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/android_container_prep.sh'
# Make Ubuntu focal image
ubuntu:focal:container_prep:
stage: container_prep
extends:
- .container-rules
- .monado.variables.ubuntu:focal
- .monado.variables.container-prep-base
- .monado.variables.debian-based-packages
- .fdo.container-build@ubuntu # from ci-templates
variables:
# a list of packages to install - assembled from .monado.variables.debian-based-packages
FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES} ${TOOLS_REQUIRED_PACKAGES}"
# Ubuntu Groovy (x64)
ubuntu:groovy:container_prep:
variables:
FDO_DISTRIBUTION_PACKAGES: 'build-essential ca-certificates cmake curl debhelper devscripts dput-ng gettext-base git glslang-tools libbluetooth-dev libbsd-dev libcjson-dev libdbus-1-dev libegl1-mesa-dev libeigen3-dev libgl1-mesa-dev libglvnd-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libhidapi-dev libopencv-dev libsdl2-dev libsystemd-dev libudev-dev libusb-1.0-0-dev libuvc-dev libv4l-dev libvulkan-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev ninja-build pandoc patch pkg-config python3 unzip wget'
# Make Ubuntu jammy image
ubuntu:jammy:container_prep:
stage: container_prep
extends:
- .monado.variables.ubuntu:groovy
- .monado.variables.container-prep-base
- .monado.variables.debian-based-packages
- .container-rules
- .monado.variables.ubuntu:jammy
- .fdo.container-build@ubuntu # from ci-templates
variables:
# a list of packages to install - assembled from .monado.variables.debian-based-packages
FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES}"
# Debian Buster + the Android NDK in /opt/android-ndk
# The NDK itself gets installed by .gitlab-ci/ndk:container_prep.sh
ndk:container_prep:
variables:
FDO_DISTRIBUTION_PACKAGES: 'build-essential ca-certificates cmake curl debhelper devscripts dput-ng gettext-base git glslang-tools libbluetooth-dev libbsd-dev libcjson-dev libdbus-1-dev libegl1-mesa-dev libeigen3-dev libgl1-mesa-dev libglvnd-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libhidapi-dev libopencv-dev libsdl2-dev libsystemd-dev libudev-dev libusb-1.0-0-dev libuvc-dev libv4l-dev libvulkan-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev ninja-build pandoc patch pkg-config python3 reprepro unzip wget'
# Make Arch image
arch:container_prep:
stage: container_prep
extends:
- .monado.variables.debian:buster-ndk
- .monado.variables.container-prep-base
- .fdo.container-build@debian # from ci-templates
- .container-rules
- .monado.variables.arch
- .fdo.container-build@arch # from ci-templates
variables:
# Repo suffix is set in .monado.variables.debian:buster-ndk
# a list of packages to install
FDO_DISTRIBUTION_PACKAGES: "${NDK_PACKAGES}"
FDO_DISTRIBUTION_PACKAGES: 'base-devel bc bluez-libs boost check clang cmake diffutils doxygen eigen fmt gcc git glew glfw-x11 glslang glu graphviz gtest gtk3 hidapi libbsd libusb libxrandr mesa meson ninja opencv patch pipewire-jack pkgconfig python-attrs python-setuptools python3 qt6-base v4l-utils vulkan-headers vulkan-icd-loader wayland wget wireplumber'
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/install-arch-additional-deps.sh'
# Make Alpine image
alpine:container_prep:
stage: container_prep
extends:
- .container-rules
- .monado.variables.alpine
- .fdo.container-build@alpine # from ci-templates
variables:
FDO_DISTRIBUTION_PACKAGES: 'build-base cmake cmd:glslangValidator cmd:wayland-scanner doxygen eigen-dev eudev-dev graphviz libjpeg-turbo-dev libsurvive-dev libxrandr-dev mesa-dev opencv-dev openhmd-dev samurai sdl2-dev v4l-utils-dev vulkan-loader-dev wayland-dev wayland-protocols zlib-dev'
###
# Container usage base jobs
# Base for using Debian bullseye image
.monado.image.debian:bullseye:
extends:
- .monado.variables.debian:bullseye
- .fdo.distribution-image@debian # from ci-templates
- .build-rules
# Base for using Debian bookworm-ndk image
.monado.image.debian:bookworm-ndk:
extends:
- .monado.variables.debian:bookworm-ndk
- .fdo.suffixed-image@debian # from ci-templates
- .build-rules
# Base for using Ubuntu focal image
.monado.image.ubuntu:focal:
extends:
- .monado.variables.ubuntu:focal
- .fdo.distribution-image@ubuntu # from ci-templates
- .build-rules
# Base for using Ubuntu jammy image
.monado.image.ubuntu:jammy:
extends:
- .monado.variables.ubuntu:jammy
- .fdo.distribution-image@ubuntu # from ci-templates
- .build-rules
# Base for using Arch image
.monado.image.arch:
extends:
- .monado.variables.arch
- .fdo.distribution-image@arch # from ci-templates
- .build-rules
# Base for using Alpine image
.monado.image.alpine:
extends:
- .monado.variables.alpine
- .fdo.distribution-image@alpine # from ci-templates
- .build-rules
# Style check job
format-and-spellcheck:
extends:
- .monado.variables.debian:buster
- .fdo.distribution-image@debian # from ci-templates
- .monado.image.debian:bullseye
stage: build
script:
- scripts/format-and-spellcheck.sh
@ -161,6 +302,8 @@ format-and-spellcheck:
# Verify REUSE compliance
reuse:
extends:
- .build-rules
stage: build
image:
name: fsfe/reuse:latest
@ -168,269 +311,354 @@ reuse:
script:
- reuse lint
# "Base" job for a CMake build
.monado.base-job.build-cmake:
stage: build
script:
- rm -rf build
- mkdir build
- pushd build
- cmake -GNinja .. $CMAKE_ARGS
# List build options
- grep "^XRT_" CMakeCache.txt
- ninja
- ctest --output-on-failure
# "Base" job for a Meson build
.monado.base-job.build-meson:
stage: build
script:
- rm -rf build
- mkdir build
- pushd build
- meson .. $MESON_ARGS
- ninja
debian:cmake:
stage: build
extends:
- .monado.variables.debian:buster
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-cmake
- .monado.packaging.conditions
- .monado.image.debian:bullseye
before_script:
# Generate "changes since last release" and add to changelog,
# since this is the build that makes our docs.
- pip3 install proclamation
- pushd doc/changes
- proclamation build --overwrite vNEXT
- proclamation build vNEXT
- popd
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh -DBUILD_DOC=ON
- cd build && ctest --output-on-failure
artifacts:
paths:
- build/doc/html/
debian:cmake-no-opencv:
extends:
- .monado.variables.debian:buster
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-cmake
variables:
CMAKE_ARGS: -DXRT_HAVE_OPENCV=OFF
debian:cmake-no-opengl:
extends:
- .monado.variables.debian:buster
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-cmake
variables:
CMAKE_ARGS: -DXRT_HAVE_OPENGL=OFF
debian:cmake-no-sdl2:
extends:
- .monado.variables.debian:buster
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-cmake
variables:
CMAKE_ARGS: -DXRT_HAVE_SDL2=OFF
debian:cmake-no-service:
extends:
- .monado.variables.debian:buster
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-cmake
variables:
CMAKE_ARGS: -DXRT_FEATURE_SERVICE=OFF
arch:cmake:
extends:
- .monado.variables.arch:rolling
- .fdo.distribution-image@arch # from ci-templates
- .monado.base-job.build-cmake
arch:cmake:clang:
extends:
- .monado.variables.arch:rolling
- .fdo.distribution-image@arch # from ci-templates
- .monado.base-job.build-cmake
variables:
CMAKE_ARGS: -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
ubuntu:cmake:
extends:
- .monado.variables.ubuntu:focal
- .fdo.distribution-image@ubuntu # from ci-templates
- .monado.base-job.build-cmake
debian:meson:
extends:
- .monado.variables.debian:buster
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-meson
ubuntu:meson:
extends:
- .monado.variables.ubuntu:focal
- .fdo.distribution-image@ubuntu # from ci-templates
- .monado.base-job.build-meson
arch:meson:
extends:
- .monado.variables.arch:rolling
- .fdo.distribution-image@arch # from ci-templates
- .monado.base-job.build-meson
variables:
MESON_ARGS: -Ddocs=disabled
# Cross-compiling
debian:meson:32bit:
extends:
- .monado.variables.debian:buster
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-meson
variables:
MESON_ARGS: --prefix /usr --libdir /usr/lib/i386-linux-gnu --cross-file ../.gitlab-ci/i386-cross.txt
debian:cmake:32bit:
extends:
- .monado.variables.debian:buster
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-cmake
variables:
# OpenCV and local OpenHMD doesn't play nicely with us in multi-arch.
CMAKE_ARGS: -DCMAKE_TOOLCHAIN_FILE=../.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=off -DXRT_BUILD_DRIVER_OHMD=off
# Base of Android NDK builds.
# Takes the last :-delimited part of the name as the ABI to build for,
# so you don't need to do anything other than "extends" in the job
.monado.ndk:build-base:
stage: build
extends:
- .monado.variables.debian:buster-ndk
- .fdo.suffixed-image@debian # from ci-templates
variables:
ANDROID_PLATFORM: 26
- .monado.image.debian:bullseye
script:
- mkdir build
- pushd build
# This extracts the ABI from the job name
- export ABI=$(echo $CI_JOB_NAME | cut --delimiter=":" -f 2)
# Note we are pointing CMake to the host install of Eigen3 because it's header-only
# and thus this is safe to do.
- cmake -GNinja .. -DANDROID_PLATFORM=$ANDROID_PLATFORM -DANDROID_ABI=$ABI -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3/
- grep "^XRT_" CMakeCache.txt
- ninja
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh -DXRT_HAVE_OPENCV=OFF
- cd build && ctest --output-on-failure
debian:cmake-no-sdl2:
stage: build
extends:
- .monado.image.debian:bullseye
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh -DXRT_HAVE_SDL2=OFF
- cd build && ctest --output-on-failure
debian:cmake-no-service:
stage: build
extends:
- .monado.image.debian:bullseye
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh -DXRT_FEATURE_SERVICE=OFF
- cd build && ctest --output-on-failure
debian:cmake:32bit:
stage: build
extends:
- .monado.image.debian:bullseye
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh -DCMAKE_TOOLCHAIN_FILE=.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=OFF
- cd build && ctest --output-on-failure
ndk:armeabi-v7a:
extends: .monado.ndk:build-base
stage: build
extends:
- .monado.image.debian:bookworm-ndk
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=26 -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3/ -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3
ndk:arm64-v8a:
extends: .monado.ndk:build-base
# Packaging
.monado.packaging.conditions:
rules:
# Only the default branch of the "upstream" repo.
- if: "$CI_PROJECT_PATH == $FDO_UPSTREAM_REPO && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
when: on_success
# Otherwise, don't build packages.
- when: never
.monado.base-job.debuild:
stage: build
extends:
- .monado.image.debian:bookworm-ndk
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=26 -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3/ -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3
android:spotlessCheck:
stage: build
extends:
- .monado.image.debian:bookworm-ndk
before_script:
# For caching gradle stuff
- export GRADLE_USER_HOME=`pwd`/.gradlehome
variables:
GRADLE_ARGS: "-Porg.gradle.daemon=false "
cache:
paths:
- .gradlehome/wrapper
- .gradlehome/caches
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-gradle-build.sh spotlessCheck
android:outOfProcessDebug:
stage: build
extends:
- .monado.image.debian:bookworm-ndk
before_script:
# For caching gradle stuff
- export GRADLE_USER_HOME=`pwd`/.gradlehome
variables:
GRADLE_ARGS: "-Porg.gradle.daemon=false "
cache:
paths:
- .gradlehome/wrapper
- .gradlehome/caches
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-gradle-build.sh assembleOutOfProcessDebug
artifacts:
paths:
- src/xrt/targets/openxr_android/build/outputs/apk/outOfProcess
android:inProcessDebug:
stage: build
extends:
- .monado.image.debian:bookworm-ndk
before_script:
# For caching gradle stuff
- export GRADLE_USER_HOME=`pwd`/.gradlehome
variables:
GRADLE_ARGS: "-Porg.gradle.daemon=false "
cache:
paths:
- .gradlehome/wrapper
- .gradlehome/caches
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-gradle-build.sh assembleInProcessDebug
artifacts:
paths:
- src/xrt/targets/openxr_android/build/outputs/apk/inProcess
android:outOfProcessRelease:
stage: build
extends:
- .monado.image.debian:bookworm-ndk
before_script:
# For caching gradle stuff
- export GRADLE_USER_HOME=`pwd`/.gradlehome
variables:
GRADLE_ARGS: "-Porg.gradle.daemon=false "
cache:
paths:
- .gradlehome/wrapper
- .gradlehome/caches
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-gradle-build.sh assembleOutOfProcessRelease
artifacts:
paths:
- src/xrt/targets/openxr_android/build/outputs/apk/outOfProcess
android:inProcessRelease:
stage: build
extends:
- .monado.image.debian:bookworm-ndk
before_script:
# For caching gradle stuff
- export GRADLE_USER_HOME=`pwd`/.gradlehome
variables:
GRADLE_ARGS: "-Porg.gradle.daemon=false "
cache:
paths:
- .gradlehome/wrapper
- .gradlehome/caches
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-gradle-build.sh assembleInProcessRelease
artifacts:
paths:
- src/xrt/targets/openxr_android/build/outputs/apk/inProcess
ubuntu:focal:cmake:
stage: build
extends:
- .monado.image.ubuntu:focal
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh
- cd build && ctest --output-on-failure
ubuntu:jammy:cmake:
stage: build
extends:
- .monado.image.ubuntu:jammy
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh
- cd build && ctest --output-on-failure
arch:cmake:
stage: build
extends:
- .monado.image.arch
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh
- cd build && ctest --output-on-failure
arch:cmake:clang:
stage: build
extends:
- .monado.image.arch
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
- cd build && ctest --output-on-failure
alpine:cmake:
stage: build
extends:
- .monado.image.alpine
script:
- .gitlab-ci/prebuild.sh
- .gitlab-ci/ci-cmake-build.sh
- cd build && ctest --output-on-failure
# Windows build
windows:
stage: build
extends:
- .monado.image.windows
script:
- ./.gitlab-ci/windows/monado_build.ps1 -Install -RunTests
artifacts:
when: always
paths:
- install
- build/Testing/Temporary
debian:bullseye:package:
extends:
- .monado.image.debian:bullseye
- .monado.packaging.conditions
variables:
GIT_STRATEGY: clone
DEBFULLNAME: "Monado CI"
DEBEMAIL: "rylie.pavlik@collabora.com"
DISTRO: debian
CODENAME: bullseye
DEB_VERSION_SUFFIX: bpo11
stage: package
before_script:
# Configure git - needed despite not actually committing here.
- git config --global user.email "ryan.pavlik@collabora.com"
- git config --global user.name "Monado CI"
- git config --global user.name Monado CI
- git config --global user.email rylie.pavlik@collabora.com
script:
- .gitlab-ci/prebuild.sh
# Prep the source tree
- git clean -dfx
- git merge origin/${PACKAGE_BRANCH} --no-commit
- DEBFULLNAME="Monado CI" DEBEMAIL="ryan.pavlik@collabora.com" debian/extra/prepare-commit-package.sh ${CI_COMMIT_SHA} 1~${BACKPORT_SUFFIX}~ci$(date --utc "+%Y%m%d")
# Build the package
- debuild -uc -us
# Use dput-ng to move the package-related files into some artifacts.
- export INCOMING=$(pwd)/incoming
- mkdir -p $INCOMING
- mkdir -p ~/.dput.d/profiles
- cat .gitlab-ci/localhost.json | envsubst > ~/.dput.d/profiles/localhost.json
- dpkg-parsechangelog --show-field version > incoming/${DISTRO}.distro
- dput --debug localhost ../monado_$(dpkg-parsechangelog --show-field version)_amd64.changes
# Call this script to build binary and source packages.
# Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints.
- .gitlab-ci/build-and-submit-package.sh
artifacts:
paths:
- "incoming/"
expire_in: 2 days
debian:buster:package:
extends:
- .monado.variables.debian:buster
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.debuild
variables:
BACKPORT_SUFFIX: bpo10
PACKAGE_BRANCH: debian/buster-backports
DISTRO: buster
ubuntu:focal:package:
extends:
- .monado.variables.ubuntu:focal
- .fdo.distribution-image@ubuntu # from ci-templates
- .monado.base-job.debuild
- .monado.image.ubuntu:focal
- .monado.packaging.conditions
variables:
BACKPORT_SUFFIX: ubuntu20.04
PACKAGE_BRANCH: ubuntu/focal
DISTRO: focal
GIT_STRATEGY: clone
DEBFULLNAME: "Monado CI"
DEBEMAIL: "rylie.pavlik@collabora.com"
DISTRO: ubuntu
CODENAME: focal
DEB_VERSION_SUFFIX: ubuntu2004
stage: package
before_script:
- git config --global user.name Monado CI
- git config --global user.email rylie.pavlik@collabora.com
script:
- .gitlab-ci/prebuild.sh
# Prep the source tree
- git clean -dfx
# Call this script to build binary and source packages.
# Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints.
- .gitlab-ci/build-and-submit-package.sh
artifacts:
paths:
- "incoming/"
expire_in: 2 days
ubuntu:groovy:package:
ubuntu:jammy:package:
extends:
- .monado.variables.ubuntu:groovy
- .fdo.distribution-image@ubuntu # from ci-templates
- .monado.base-job.debuild
- .monado.image.ubuntu:jammy
- .monado.packaging.conditions
variables:
BACKPORT_SUFFIX: ubuntu20.04
PACKAGE_BRANCH: ubuntu/focal
DISTRO: focal
GIT_STRATEGY: clone
DEBFULLNAME: "Monado CI"
DEBEMAIL: "rylie.pavlik@collabora.com"
DISTRO: ubuntu
CODENAME: jammy
DEB_VERSION_SUFFIX: ubuntu2204
stage: package
before_script:
- git config --global user.name Monado CI
- git config --global user.email rylie.pavlik@collabora.com
script:
- .gitlab-ci/prebuild.sh
# Prep the source tree
- git clean -dfx
# Call this script to build binary and source packages.
# Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints.
- .gitlab-ci/build-and-submit-package.sh
artifacts:
paths:
- "incoming/"
expire_in: 2 days
reprepro:package:
stage: reprepro
extends:
- .monado.variables.debian:buster
- .monado.image.ubuntu:jammy
- .monado.packaging.conditions
- .fdo.distribution-image@debian # from ci-templates
dependencies:
- debian:buster:package
needs:
- debian:bullseye:package
- ubuntu:focal:package
- ubuntu:groovy:package
before_script:
# Convince gnupg to work properly in CI
- mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
- touch ~/.gnupg/gpg.conf
- echo 'use-agent' > ~/.gnupg/gpg.conf
- echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf
- touch ~/.gnupg/gpg-agent.conf
- echo 'allow-loopback-pinentry' > ~/.gnupg/gpg-agent.conf
- echo RELOADAGENT | gpg-connect-agent
- gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE} --import ${MONADO_GPG_SECRET_KEY}
- ubuntu:jammy:package
script:
# Use reprepro to create an apt repository in our artifacts
- mkdir -p repo/conf
# For each distro, sign the changes file and add it to the repo.
- |
for fn in incoming/*.distro; do
# parse the distro name out
export DISTRO=$(echo $fn | sed -e 's:incoming/::' -e 's:[.]distro::')
echo "Processing $DISTRO"
# add distro to repository config - blank line is mandatory!
cat .gitlab-ci/distributions | envsubst >> repo/conf/distributions
echo >> repo/conf/distributions
echo "Signing package for $DISTRO"
debsign -k ${MONADO_GPG_FINGERPRINT} -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" incoming/monado_$(cat $fn)_amd64.changes
echo "Adding package for $DISTRO to the repository"
reprepro -V --ignore=wrongdistribution -b repo include ${DISTRO} incoming/monado_$(cat $fn)_amd64.changes
done
- bash .gitlab-ci/reprepro.sh
artifacts:
paths:
- "repo/"
@ -441,9 +669,9 @@ reprepro:package:
###
pages:
stage: pages
only:
- master
dependencies:
extends:
- .monado.packaging.conditions
needs:
- debian:cmake
- reprepro:package
script:

38
.gitlab-ci/README.md Normal file
View file

@ -0,0 +1,38 @@
# CI and Generated Stuff Readme
<!--
# Copyright 2018-2023 Collabora, Ltd. and the Monado contributors
#
# SPDX-License-Identifier: CC0-1.0
-->
We use the FreeDesktop
["CI Templates"](https://freedesktop.pages.freedesktop.org/ci-templates) to
maintain build containers using code in this repo, storing the images in GitLab
Registry. Our CI files (and some other files) are auto-generated from Jinja
templates and `config.yml`, using
[ci-fairy](https://freedesktop.pages.freedesktop.org/ci-templates/ci-fairy.html).
You can install it with:
<!-- do not break the following line, it is used in CI setup too, to make sure it works -->
```sh
python3 -m pip install git+https://gitlab.freedesktop.org/freedesktop/ci-templates@185ede0e9b9b1924b92306ab8b882a6294e92613
```
On Windows you will also need to have GNU make and busybox installed, such as with:
```pwsh
scoop install make busybox
```
To re-generate files, from the root directory, run:
```sh
make -f .gitlab-ci/ci-scripts.mk
```
If you really want to force rebuilding, you can build the clean target first:
```sh
make -f .gitlab-ci/ci-scripts.mk clean all
```

View file

@ -0,0 +1,9 @@
#!/bin/bash
# Copyright 2018-2020, 2022, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
(
cd $(dirname $0)
bash ./install-ndk.sh
bash ./install-android-sdk.sh
)

View file

@ -1,8 +0,0 @@
#!/bin/sh
# Copyright 2018-2020, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
(
cd $(dirname $0)
bash ./build-openxr-openhmd.sh
)

View file

@ -0,0 +1,38 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
#
# Requires some environment variables (normally set by CI)
# Any extra args get passed to debuild, so try -B for a local binary-only build
set -euo pipefail
echo "DISTRO ${DISTRO}"
echo "CODENAME ${CODENAME}"
echo "DEB_VERSION_SUFFIX ${DEB_VERSION_SUFFIX}"
echo "CI_COMMIT_SHA ${CI_COMMIT_SHA}"
git remote update --prune
# Prep the source tree: grab the debian directory from the packaging branch.
git checkout "origin/${DISTRO}/${CODENAME}" -- debian/
datestamp=$(date --utc "+%Y%m%d")
if [ ! "${CI_COMMIT_SHA}" ]; then
echo "Why don't I know what the commit hash is?"
exit 1
fi
debian/extra/prepare-commit-package.sh "${CI_COMMIT_SHA}" "1~${DEB_VERSION_SUFFIX}~ci${datestamp}"
# Build the package
debuild -uc -us "$@"
# Stash the package version in a convenient file for a later job.
INCOMING="$(pwd)/incoming"
export INCOMING
mkdir -p "$INCOMING"
dpkg-parsechangelog --show-field version > "incoming/${CODENAME}.distro"
# Use dput-ng to move the package-related files into some artifacts.
mkdir -p ~/.dput.d/profiles
envsubst < .gitlab-ci/localhost.json > ~/.dput.d/profiles/localhost.json
dput --debug localhost "../monado_$(dpkg-parsechangelog --show-field version)_amd64.changes"

View file

@ -1,22 +0,0 @@
#!/bin/sh
# Copyright 2018-2020, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
# Install the OpenXR SDK, whatever version, installed system-wide.
git clone https://github.com/KhronosGroup/OpenXR-SDK
pushd OpenXR-SDK
mkdir build
pushd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=Off -DPRESENTATION_BACKEND=xlib -DDYNAMIC_LOADER=ON -DOpenGL_GL_PREFERENCE=GLVND -GNinja ..
ninja install
popd
popd
# Install OpenHMD from git master, as released versions are not sufficient
# for us to build.
git clone https://github.com/OpenHMD/OpenHMD
pushd OpenHMD
mkdir build
meson --prefix=/usr/local --libdir=lib build
ninja -C build install
popd

10
.gitlab-ci/ci-cmake-build.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
set -e
set -x
rm -rf build
cmake -GNinja -B build -S . "$@"
echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
ninja -C build

13
.gitlab-ci/ci-gradle-build.sh Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
set -e
MAX_WORKERS="${FDO_CI_CONCURRENT:-4}"
export GRADLE_ARGS="-Porg.gradle.daemon=false "
set -x
cp .gitlab-ci/local.properties .
./gradlew clean
./gradlew --max-workers "$MAX_WORKERS" "$@"

78
.gitlab-ci/ci-rules.yml Normal file
View file

@ -0,0 +1,78 @@
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2018-2023 the Mesa contributors
# SPDX-FileCopyrightText: 2018-2023 Collabora, Ltd. and the Monado contributors
# YAML anchors for rule conditions
# --------------------------------
.rules-anchors:
rules:
# Post-merge pipeline
- if: &is-post-merge '$CI_PROJECT_NAMESPACE == "monado" && $CI_COMMIT_BRANCH'
when: on_success
# Pre-merge pipeline
- if: &is-pre-merge '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_success
# Outside of monado.
- if: &is-forked-branch '$CI_PROJECT_NAMESPACE != "monado" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
when: manual
# GitLab CI paths
- changes: &paths-ci-files
- ".gitlab-ci.yml"
- ".gitlab-ci/**/*"
when: on_success
# All paths, 1 hours have been wasted trying to combine the above arrays.
- changes: &paths-all-files
# Code
- "scripts/**/*"
- "src/**/*"
# Doc
- "doc/**/*"
# Build sys
- CMakeLists.txt
- "*.cmake"
- "**/*.gradle"
- "cmake/**/*"
- "gradle/**/*"
# CI paths
- ".gitlab-ci.yml"
- ".gitlab-ci/**/*"
when: on_success
# When to automatically run the CI for build jobs
.build-rules:
rules:
# If any files affecting the pipeline are changed, build/test jobs run
# automatically once all dependency jobs have passed
- changes:
*paths-all-files
when: on_success
# Don't build on forked repos.
- if: *is-forked-branch
when: manual
# Otherwise, build/test jobs won't run because no rule matched.
.container-rules:
rules:
# Run pipeline by default in the main project if any CI pipeline
# configuration files were changed, to ensure docker images are up to date
- if: *is-post-merge
changes:
*paths-ci-files
when: on_success
# Run pipeline by default if it is for a merge request, and any files
# affecting the pipeline were changed
- if: *is-pre-merge
changes:
*paths-all-files
when: on_success
# Allow triggering jobs manually in other cases if any files affecting the
# pipeline were changed: Disabled for now because it causes the pipeline on
# main to be blocked because it gets stuck in the container stage.
#- changes:
# *paths-ci-files
# when: manual
# Don't build on forked repos.
- if: *is-forked-branch
when: manual
# Otherwise, container jobs won't run because no rule matched.

38
.gitlab-ci/ci-scripts.mk Normal file
View file

@ -0,0 +1,38 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2022-2023 Collabora, Ltd. and the Monado contributors
#
# To generate all the templated files, run this from the root of the repo:
# make -f .gitlab-ci/ci-scripts.mk
# These also all have their template named the same with a .jinja suffix in the template subdir.
FILES_IN_SUBDIR := \
.gitlab-ci/distributions \
.gitlab-ci/reprepro.sh \
.gitlab-ci/install-android-sdk.sh \
CONFIG_FILE := .gitlab-ci/config.yml
OUTPUTS := .gitlab-ci.yml \
$(FILES_IN_SUBDIR)
all: $(OUTPUTS)
chmod +x .gitlab-ci/*.sh
.PHONY: all
clean:
rm -f $(OUTPUTS)
.PHONY: clean
CI_FAIRY := ci-fairy generate-template --config=$(CONFIG_FILE)
# Because we have includes, and it goes to a different directory, this is special cased
.gitlab-ci.yml: .gitlab-ci/templates/.gitlab-ci.yml.jinja $(CONFIG_FILE)
$(CI_FAIRY) $< > $@
# Extra deps
.gitlab-ci.yml: .gitlab-ci/templates/include.win_containers.yml
.gitlab-ci.yml: .gitlab-ci/templates/include.ci-containers-variables.yml.jinja
.gitlab-ci.yml: .gitlab-ci/templates/include.ci-containers.yml.jinja
.gitlab-ci.yml: .gitlab-ci/templates/include.functions.jinja
# Everything else is structured alike
$(FILES_IN_SUBDIR): .gitlab-ci/%: .gitlab-ci/templates/%.jinja $(CONFIG_FILE)
$(CI_FAIRY) $< > $@

287
.gitlab-ci/config.yml Normal file
View file

@ -0,0 +1,287 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2023 Collabora, Ltd. and the Monado contributors
# Please run the following from the repo root after modifying this file:
# make -f .gitlab-ci/ci-scripts.mk
fdo_ci_templates_sha: 185ede0e9b9b1924b92306ab8b882a6294e92613
# These are a mapping, instead of a list/array, so we can merge.
.default_debian_packages:
&default_debian_packages # Packages required for build and some other basic jobs
build-essential:
git:
wget:
unzip:
cmake:
ninja-build:
libeigen3-dev:
curl:
patch:
python3:
pkg-config:
libx11-dev:
libx11-xcb-dev:
libxxf86vm-dev:
libxrandr-dev:
libxcb-randr0-dev:
libvulkan-dev:
glslang-tools:
libglvnd-dev:
libgl1-mesa-dev:
ca-certificates:
libusb-1.0-0-dev:
libudev-dev:
# These are optional packages, that we're building against to ensure we build as much code as possible
libhidapi-dev:
libwayland-dev:
libuvc-dev:
libopencv-dev:
libv4l-dev:
libcjson-dev:
libsdl2-dev:
libegl1-mesa-dev:
libdbus-1-dev:
libgstreamer1.0-dev:
libgstreamer-plugins-base1.0-dev:
libsystemd-dev:
libbsd-dev:
libbluetooth-dev:
# Only used for building packages
devscripts:
debhelper:
dput-ng:
gettext-base:
pandoc:
# These config defines are used for all NDK builds
.android_cmake_defines: &android_cmake_defines
ANDROID_PLATFORM: 26
CMAKE_TOOLCHAIN_FILE: /opt/android-ndk/build/cmake/android.toolchain.cmake
Eigen3_DIR: /usr/lib/cmake/eigen3/
EIGEN3_INCLUDE_DIR: /usr/include/eigen3
# Which build job do we use to build the documentation.
documentation_build: "debian:cmake"
# The distributions we'll make an image for
distributions:
- name: debian
images:
# This image does some extra work.
- codename: bullseye
script: i386_and_proclamation_container_prep.sh
tag: "2024-01-16"
deb_version_suffix: bpo11
packages:
<<: *default_debian_packages
codespell:
doxygen:
graphviz:
python3-pip:
python3-click:
clang-format:
build_jobs:
- name: "debian:cmake"
# Generate "changes since last release" and add to changelog,
# since this is the build that makes our docs.
before_script:
- pushd doc/changes
- proclamation build vNEXT
- popd
artifact_path: build/doc/html/
cmake_defines:
BUILD_DOC: "ON"
- name: "debian:cmake-no-opencv"
cmake_defines:
XRT_HAVE_OPENCV: "OFF"
- name: "debian:cmake-no-sdl2"
cmake_defines:
XRT_HAVE_SDL2: "OFF"
- name: "debian:cmake-no-service"
cmake_defines:
XRT_FEATURE_SERVICE: "OFF"
- name: "debian:cmake:32bit"
cmake_defines:
CMAKE_TOOLCHAIN_FILE: .gitlab-ci/i386.cmake
# OpenCV doesn't play nicely with us in multi-arch.
XRT_HAVE_OPENCV: "OFF"
# This one is pretty minimal, compared to the others.
# Though, we now install the android SDK in it...
- codename: bookworm-ndk
distro_version: bookworm
repo_suffix: ndk
script: android_container_prep.sh
tag: "2024-01-16"
# This must match ext.sharedCompileSdk in build.gradle
android_compile_sdk: 32
# This must match buildscript.ext.buildToolsVersion in build.gradle
android_build_tools: 32.0.0
# look up on https://developer.android.com/studio/index.html#downloads when updating other versions
android_cli_tools: 9477386
packages:
git:
wget:
unzip:
cmake:
meson:
ninja-build:
libeigen3-dev:
python3:
pkg-config:
ca-certificates:
glslang-tools:
default-jdk-headless:
build_jobs:
- name: "ndk:armeabi-v7a"
cmake_defines:
<<: *android_cmake_defines
ANDROID_ABI: armeabi-v7a
- name: "ndk:arm64-v8a"
cmake_defines:
<<: *android_cmake_defines
ANDROID_ABI: arm64-v8a
- name: android:spotlessCheck
target: spotlessCheck
- name: android:outOfProcessDebug
target: assembleOutOfProcessDebug
artifact_path: src/xrt/targets/openxr_android/build/outputs/apk/outOfProcess
- name: android:inProcessDebug
target: assembleInProcessDebug
artifact_path: src/xrt/targets/openxr_android/build/outputs/apk/inProcess
- name: android:outOfProcessRelease
target: assembleOutOfProcessRelease
artifact_path: src/xrt/targets/openxr_android/build/outputs/apk/outOfProcess
- name: android:inProcessRelease
target: assembleInProcessRelease
artifact_path: src/xrt/targets/openxr_android/build/outputs/apk/inProcess
- name: ubuntu
images:
# LTS
- codename: focal
distro_version: "20.04"
tag: "2024-01-16"
deb_version_suffix: ubuntu2004
packages:
<<: *default_debian_packages
build_jobs:
- name: "ubuntu:focal:cmake"
cmake_defines:
- codename: jammy
distro_version: "22.04"
tag: "2024-01-16"
deb_version_suffix: ubuntu2204
packages:
<<: *default_debian_packages
reprepro:
build_jobs:
- name: "ubuntu:jammy:cmake"
cmake_defines:
- name: arch
images:
- tag: "2024-01-16"
script: install-arch-additional-deps.sh
# pipewire-jack wireplumber: Explicitly choose dependencies to avoid pacman asking interactively
# python-setuptools glu: librealsense
# glew boost gtest fmt bc: basalt-monado-git
# python-attrs: xr-hardware-git
packages:
base-devel:
pipewire-jack:
wireplumber:
bluez-libs:
check:
clang:
cmake:
diffutils:
doxygen:
eigen:
gcc:
git:
glfw-x11:
glslang:
graphviz:
gtk3:
hidapi:
libusb:
libxrandr:
mesa:
ninja:
opencv:
patch:
pkgconfig:
python3:
qt6-base:
v4l-utils:
vulkan-headers:
vulkan-icd-loader:
wget:
meson:
python-setuptools:
glu:
glew:
boost:
gtest:
fmt:
bc:
wayland:
libbsd:
python-attrs:
build_jobs:
- name: "arch:cmake"
- name: "arch:cmake:clang"
cmake_defines:
CMAKE_C_COMPILER: /usr/bin/clang
CMAKE_CXX_COMPILER: /usr/bin/clang++
- name: alpine
images:
- tag: "2024-01-16"
packages:
- "cmake"
- "cmd:glslangValidator"
- "cmd:wayland-scanner"
- "build-base"
- "doxygen"
- "eigen-dev"
- "eudev-dev"
- "graphviz"
- "libjpeg-turbo-dev"
- "libsurvive-dev"
- "libxrandr-dev"
- "mesa-dev"
- "opencv-dev"
- "openhmd-dev"
- "samurai"
- "sdl2-dev"
- "v4l-utils-dev"
- "vulkan-loader-dev"
- "wayland-dev"
- "wayland-protocols"
- "zlib-dev"
build_jobs:
- name: "alpine:cmake"
android:
platform: 26
packaging:
# Name and email associated with the package
name: "Monado CI"
email: "rylie.pavlik@collabora.com"

View file

@ -1,12 +0,0 @@
#!/bin/bash
# Copyright 2018-2020, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
(
cd $(dirname $0)
bash ./install-cross.sh
)
(
cd $(dirname $0)
bash ./build-openxr-openhmd.sh
)

View file

@ -1,7 +1,24 @@
Origin: monado.freedesktop.org
Description: Monado CI apt repository
Codename: ${DISTRO}
Codename: bullseye
Architectures: amd64 i386 source
Components: main
Tracking: minimal
SignWith: ${MONADO_GPG_FINGERPRINT}
Origin: monado.freedesktop.org
Description: Monado CI apt repository
Codename: focal
Architectures: amd64 i386 source
Components: main
Tracking: minimal
SignWith: ${MONADO_GPG_FINGERPRINT}
Origin: monado.freedesktop.org
Description: Monado CI apt repository
Codename: jammy
Architectures: amd64 i386 source
Components: main
Tracking: minimal
SignWith: ${MONADO_GPG_FINGERPRINT}

View file

@ -1,3 +1,5 @@
Copyright 2020, Collabora, Ltd.
Copyright 2020-2022, Collabora, Ltd.
SPDX-License-Identifier: BSL-1.0
SPDX-License-Identifier: BSL-1.0
Generated from distributions.jinja with ci-fairy

View file

@ -0,0 +1,5 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
# Used for CI package building.
allow-loopback-pinentry

6
.gitlab-ci/gpg.conf Normal file
View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
# Used for CI package building.
use-agent
pinentry-mode loopback

View file

@ -1,21 +0,0 @@
# SPDX-FileCopyrightText: 2018-2020, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: CC0-1.0
[binaries]
c = '/usr/bin/i686-linux-gnu-gcc'
cpp = '/usr/bin/i686-linux-gnu-g++'
ar = '/usr/bin/i686-linux-gnu-ar'
strip = '/usr/bin/i686-linux-gnu-strip'
objcopy = '/usr/bin/i686-linux-gnu-objcopy'
ld= '/usr/bin/i686-linux-gnu-ld'
pkgconfig = '/usr/bin/i686-linux-gnu-pkg-config'
sdl2-config = '/bin/false'
[properties]
needs_exe_wrapper = False
[host_machine]
system = 'linux'
cpu_family = 'x86'
cpu = 'i386'
endian = 'little'

View file

@ -0,0 +1,12 @@
#!/bin/bash
# Copyright 2018-2022, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
(
cd $(dirname $0)
bash ./install-cross.sh
# Using this script "follows the instructions" for some testing of our instructions.
bash ./install-ci-fairy.sh
)
python3 -m pip install proclamation cmakelang

View file

@ -0,0 +1,42 @@
#!/usr/bin/env bash
# Copyright 2022, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
##
#######################################################
# GENERATED - DO NOT EDIT #
# see .gitlab-ci/install-android-sdk.sh.jinja instead #
#######################################################
##
# Partially inspired by https://about.gitlab.com/blog/2018/10/24/setting-up-gitlab-ci-for-android-projects/
set -eo pipefail
VERSION=9477386
ROOT=${ROOT:-/opt/android-sdk}
ANDROID_COMPILE_SDK=${ANDROID_COMPILE_SDK:-32}
ANDROID_BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-32.0.0}
mkdir -p "$ROOT"
FN=commandlinetools-linux-${VERSION}_latest.zip
wget https://dl.google.com/android/repository/$FN
unzip $FN -d "$ROOT/extract"
mkdir -p "$ROOT/cmdline-tools"
mv "$ROOT/extract/cmdline-tools/" "$ROOT/cmdline-tools/latest/"
mv "$ROOT/extract/" "$ROOT/cmdline-tools/"
SDKMANAGER=$ROOT/cmdline-tools/latest/bin/sdkmanager
echo "Installing the Android compile SDK platform android-${ANDROID_COMPILE_SDK}"
echo y | $SDKMANAGER "platforms;android-${ANDROID_COMPILE_SDK}" >> /dev/null
echo "Installing the Android platform tools"
echo y | $SDKMANAGER "platform-tools" >> /dev/null
echo "Installing the Android build tools ${ANDROID_BUILD_TOOLS}"
echo y | $SDKMANAGER "build-tools;${ANDROID_BUILD_TOOLS}" >> /dev/null
set +o pipefail
yes | $SDKMANAGER --licenses
set -o pipefail

View file

@ -0,0 +1,40 @@
#!/bin/bash
# Copyright 2023, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
cd $(dirname $0)
mkdir -p deps
pushd deps
# xr-hardware-git required by libsurvive-git
# libuvc required by basalt
for PKG in \
xr-hardware-git \
libsurvive-git \
percetto-git \
openhmd-git \
librealsense \
onnxruntime-git \
leap-motion \
libuvc-git \
basalt-monado-git \
do
wget https://aur.archlinux.org/cgit/aur.git/snapshot/"$PKG".tar.gz
tar xfz "$PKG".tar.gz
pushd "$PKG"
# makepkg can not be run as root
chown nobody:users .
su nobody -s /bin/bash -c "MAKEFLAGS=-j$(nproc) makepkg -fs"
pacman -U --noconfirm *.pkg.*
popd
done
popd
# don't keep gigabytes of source code in the container image
rm -rf deps

11
.gitlab-ci/install-ci-fairy.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/sh
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
# This runs the command in the README as an extra bit of continuous integration.
set -e
(
cd "$(dirname "$0")"
sh -c "$(grep '^python3 -m pip' README.md)"
)

14
.gitlab-ci/install-cross.sh Normal file → Executable file
View file

@ -23,7 +23,6 @@ for arch in $CROSS_ARCHITECTURES; do
apt-get install -y --no-install-recommends --no-remove \
crossbuild-essential-${arch} \
libelf-dev:${arch} \
libavcodec-dev:${arch} \
libegl1-mesa-dev:${arch} \
libgl1-mesa-dev:${arch} \
libglvnd-dev:${arch} \
@ -57,16 +56,3 @@ done
apt-get autoremove -y --purge
apt-get clean
# Generate cross build files for Meson
for arch in $CROSS_ARCHITECTURES; do
cross_file="/cross_file-$arch.txt"
/usr/share/meson/debcrossgen --arch "$arch" -o "$cross_file"
if [ "$arch" = "i386" ]; then
# Work around a bug in debcrossgen that should be fixed in the next release
sed -i "s|cpu_family = 'i686'|cpu_family = 'x86'|g" "$cross_file"
fi
# Rely on qemu-user being configured in binfmt_misc on the host
sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
done

6
.gitlab-ci/install-ndk.sh Normal file → Executable file
View file

@ -1,7 +1,9 @@
#!/bin/sh
# Copyright 2018-2020, Collabora, Ltd. and the Monado contributors
# Copyright 2018-2020, 2022, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
VERSION=r21
# aka 21.4.7075529
VERSION=r21e
FN=android-ndk-${VERSION}-linux-x86_64.zip
wget https://dl.google.com/android/repository/$FN
unzip $FN -d /opt

View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
# For building on CI
ndk.dir=/opt/android-ndk
sdk.dir=/opt/android-sdk

View file

@ -1,8 +0,0 @@
#!/bin/bash
# Copyright 2018-2020, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
(
cd $(dirname $0)
bash ./install-ndk.sh
)

22
.gitlab-ci/prebuild.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/sh
# Copyright 2020-2023, Mesa contributors
# Copyright 2020, Collabora, Ltd.
# SPDX-License-Identifier: MIT
# From https://gitlab.freedesktop.org/mesa/mesa/-/blob/999b956ebc4c26fa0c407369e630c687ece02209/.gitlab-ci/container/container_pre_build.sh
set -e
# Make a wrapper script for ninja to always include the -j flags
# to avoid oversubscribing/DOS'ing the shared runners
{
echo '#!/bin/sh -x'
# shellcheck disable=SC2016
echo '/usr/bin/ninja -j${FDO_CI_CONCURRENT:-4} "$@"'
} > /usr/local/bin/ninja
chmod +x /usr/local/bin/ninja
# Set MAKEFLAGS so that all make invocations in container builds include the
# flags (doesn't apply to non-container builds, but we don't run make there)
export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}"

61
.gitlab-ci/reprepro.sh Executable file
View file

@ -0,0 +1,61 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
###############################################
# GENERATED - DO NOT EDIT #
# see .gitlab-ci/reprepro.sh.template instead #
###############################################
set -euo pipefail
# Convince gnupg to work properly in CI
echo "Import and cache the GPG key"
mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
cp .gitlab-ci/gpg.conf .gitlab-ci/gpg-agent.conf ~/.gnupg
echo RELOADAGENT | gpg-connect-agent
gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase "${MONADO_GPG_PASSPHRASE}" --import "${MONADO_GPG_SECRET_KEY}"
echo "Prepare reprepro config"
mkdir -p repo/conf
# Substitute in the GPG fingerprint into the repository config.
# This file is itself generated with ci-fairy.
cat .gitlab-ci/distributions | envsubst > repo/conf/distributions
echo "reprepro config file:"
echo "---------------------"
cat repo/conf/distributions
echo "---------------------"
# For each distro, sign the changes file and add it to the repo.
# bullseye
if [ -f "incoming/bullseye.distro" ]; then
VERSION=$(cat incoming/bullseye.distro)
echo "Signing and processing bullseye: ${VERSION}"
debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes"
reprepro -V --ignore=wrongdistribution -b repo include bullseye "incoming/monado_${VERSION}_amd64.changes"
else
echo "Skipping bullseye - no artifact found"
fi
# focal
if [ -f "incoming/focal.distro" ]; then
VERSION=$(cat incoming/focal.distro)
echo "Signing and processing focal: ${VERSION}"
debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes"
reprepro -V --ignore=wrongdistribution -b repo include focal "incoming/monado_${VERSION}_amd64.changes"
else
echo "Skipping focal - no artifact found"
fi
# jammy
if [ -f "incoming/jammy.distro" ]; then
VERSION=$(cat incoming/jammy.distro)
echo "Signing and processing jammy: ${VERSION}"
debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes"
reprepro -V --ignore=wrongdistribution -b repo include jammy "incoming/monado_${VERSION}_amd64.changes"
else
echo "Skipping jammy - no artifact found"
fi

View file

@ -0,0 +1,246 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2023 Collabora, Ltd. and the Monado contributors
{# ignore the warning, this is actually the template to edit. #}
###############################################
# GENERATED - DO NOT EDIT
# see .gitlab-ci/ci.template, etc instead
###############################################
{# See README.md for instructions to regenerate after modification. #}
{#
useful links:
https://freedesktop.pages.freedesktop.org/ci-templates/
https://freedesktop.pages.freedesktop.org/ci-templates/ci-fairy.html#templating-gitlab-ci-yml
https://gitlab.freedesktop.org/freedesktop/ci-templates
Config file used for all templates: .gitlab-ci/config.yml
.gitlab-ci.yml template: .gitlab-ci/ci.template
.gitlab-ci/distributions template (for reprepro): .gitlab-ci/distributions.jinja
.gitlab-ci/reprepro.sh template: .gitlab-ci/reprepro.sh.jinja
The following will update all files from templates:
make -f .gitlab-ci/ci-scripts.mk
#}
# workflow:
# rules:
# - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
# - if: $CI_PIPELINE_SOURCE == 'push'
variables:
FDO_UPSTREAM_REPO: "monado/monado"
include:
- project: "freedesktop/ci-templates"
ref: {{fdo_ci_templates_sha}}
file:
{% for distro in distributions %}
- "/templates/{{distro.name}}.yml"
{% endfor %}
# - local: .gitlab-ci/containers/ci-container-prep.yml
# This include is for compatibility with the fdo CI restrictions/checks
# needed due to https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/438
- local: .gitlab-ci/ci-rules.yml
stages:
- container_prep
- build
- package
- reprepro
- pages
- deploy
###
# Extra rules for packaging
.monado.packaging.conditions:
rules:
# Only the default branch of the "upstream" repo.
- if: "$CI_PROJECT_PATH == $FDO_UPSTREAM_REPO && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
when: on_success
# Otherwise, don't build packages.
- when: never
{% include 'include.win_containers.yml' %}
{% include 'include.ci-containers-variables.yml.jinja' %}
{% include 'include.ci-containers.yml.jinja' %}
{% from 'include.functions.jinja' import image_name, base_job_to_use_image_containing, base_job_to_use_image with context %}
# Style check job
format-and-spellcheck:
extends:
- {{base_job_to_use_image_containing("codespell")}}
stage: build
script:
- scripts/format-and-spellcheck.sh
artifacts:
paths:
- patches/
expire_in: 1 week
when: on_failure
# Verify REUSE compliance
reuse:
extends:
- .build-rules
stage: build
image:
name: fsfe/reuse:latest
entrypoint: [""]
script:
- reuse lint
{% macro make_cmake_args(cmake_defines) %}
{% if cmake_defines is defined and cmake_defines %}
{%- for k, v in cmake_defines |dictsort %} -D{{ k }}={{ v }}{% endfor %}
{%- endif %}
{%- endmacro -%}
{#### Main build jobs ####}
{% for distro in distributions -%} {%- for image in distro.images if image.build_jobs -%} {%- for job in image.build_jobs %}
{{job.name}}:
stage: build
extends:
{% if job.name == documentation_build %}
- .monado.packaging.conditions
{% endif %}
- {{base_job_to_use_image(distro, image)}}
{%- if job.before_script or "android" in job.name %}
before_script:
{% endif %}
{% for line in job.before_script %}
- {{line}}
{% endfor %}
{%- if "android" in job.name %}
{# Keep this right below the before_script since this is an extra line!! #}
# For caching gradle stuff
- export GRADLE_USER_HOME=`pwd`/.gradlehome
variables:
GRADLE_ARGS: "-Porg.gradle.daemon=false "
cache:
paths:
- .gradlehome/wrapper
- .gradlehome/caches
{% endif %}
script:
- .gitlab-ci/prebuild.sh
{#- regular or NDK cmake builds -#}
{%- if "cmake" in job.name or "ndk" in job.name %}
- .gitlab-ci/ci-cmake-build.sh {{- make_cmake_args(job.cmake_defines) }}
{#- gradle builds -#}
{%- elif "android" in job.name %}
- .gitlab-ci/ci-gradle-build.sh {{ job.target }}
{%- else %}
{# error message #}
CANNOT GUESS JOB TYPE
{%- endif %}
{%- if "cmake" in job.name %}
- cd build && ctest --output-on-failure
{%- endif %}
{%- if job.artifact_path %}
artifacts:
paths:
- {{ job.artifact_path }}
{%- endif %}
{% endfor -%} {%- endfor -%} {%- endfor %}
# Windows build
windows:
stage: build
extends:
- .monado.image.windows
script:
- ./.gitlab-ci/windows/monado_build.ps1 -Install -RunTests
artifacts:
when: always
paths:
- install
- build/Testing/Temporary
{% macro packaging_job_name(distro, image) -%}
{{ image_name(distro, image) }}:package
{%- endmacro %}
{% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %}
{{packaging_job_name(distro, image)}}:
extends:
- {{base_job_to_use_image(distro, image)}}
- .monado.packaging.conditions
variables:
GIT_STRATEGY: clone
DEBFULLNAME: "{{packaging.name}}"
DEBEMAIL: "{{packaging.email}}"
DISTRO: {{distro.name}}
CODENAME: {{image.codename}}
DEB_VERSION_SUFFIX: {{image.deb_version_suffix}}
stage: package
before_script:
{# Configure git - needed despite not actually committing here. #}
- git config --global user.name {{packaging.name}}
- git config --global user.email {{packaging.email}}
script:
- .gitlab-ci/prebuild.sh
# Prep the source tree
- git clean -dfx
# Call this script to build binary and source packages.
# Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints.
- .gitlab-ci/build-and-submit-package.sh
artifacts:
paths:
- "incoming/"
expire_in: 2 days
{% endfor -%} {%- endfor %}
reprepro:package:
stage: reprepro
extends:
- {{ base_job_to_use_image_containing("reprepro") }}
- .monado.packaging.conditions
needs:
{% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %}
- {{packaging_job_name(distro, image)}}
{% endfor -%} {%- endfor %}
script:
- bash .gitlab-ci/reprepro.sh
artifacts:
paths:
- "repo/"
expire_in: 2 days
###
# Pages
###
pages:
stage: pages
extends:
- .monado.packaging.conditions
needs:
- {{ documentation_build }}
- reprepro:package
script:
- mkdir -p public
- mv build/doc/html/* public/
- mv repo public/apt
artifacts:
paths:
- public

View file

@ -0,0 +1,33 @@
{#
Copyright 2020-2022, Collabora, Ltd.
SPDX-License-Identifier: BSL-1.0
#}
{#
Template for reprepro distributions config file.
After this template gets expanded, with a paragraph for each
distribution codename supported,
the GPG fingerprint gets substituted into that at CI time using envsubst,
(not ahead of time using ci-fairy)
because the fingerprint is included in the "secrets" in CI.
Note: There is no way to indicate comments in the reprepro distributions config
file format, and whitespace is meaningful (need blank lines between paragraphs).
Please run the following after modifying this file:
ci-fairy generate-template --config .gitlab-ci/config.yml .gitlab-ci/distributions.jinja > .gitlab-ci/distributions
or better yet, use the makefile.
#}
{% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %}
Origin: monado.freedesktop.org
Description: Monado CI apt repository
Codename: {{ image.codename }}
Architectures: amd64 i386 source
Components: main
Tracking: minimal
SignWith: ${MONADO_GPG_FINGERPRINT}
{% endfor -%} {%- endfor %}

View file

@ -0,0 +1,22 @@
{#
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2023 Collabora, Ltd. and the Monado contributors
#
# This file is not used directly to generate its own output: it is included by .gitlab-ci.yml.jinja
#}
{% from 'include.functions.jinja' import image_name, image_name_for_comment with context %}
{% for distro in distributions -%} {%- for image in distro.images %}
# Variables for build and usage of {{ image_name_for_comment(distro, image) }} image
.monado.variables.{{ image_name(distro, image) }}:
variables:
{% if "codename" in image or "distro_version" in image %}
FDO_DISTRIBUTION_VERSION: "{{ image["distro_version"] | default(image.codename) }}"
{% endif %}
FDO_DISTRIBUTION_TAG: "{{ image.tag }}"
{% if "repo_suffix" in image %}
FDO_REPO_SUFFIX: {{image["repo_suffix"]}}
{% endif %}
{% endfor -%} {%- endfor %}

View file

@ -0,0 +1,45 @@
{#
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2023 Collabora, Ltd. and the Monado contributors
#
# This file is not used directly to generate its own output: it is included by .gitlab-ci.yml.jinja
#}
{% from 'include.functions.jinja' import image_name, image_name_for_comment with context %}
###
# Container prep jobs
{%- for distro in distributions -%} {%- for image in distro.images %}
# Make {{ image_name_for_comment(distro, image) }} image
{{ image_name(distro, image) }}:container_prep:
stage: container_prep
extends:
- .container-rules
- .monado.variables.{{ image_name(distro, image) }}
- .fdo.container-build@{{distro.name}} # from ci-templates
variables:
{# The packages list is actually a mapping, not an array, but the same syntax works. #}
{# Needed to be a mapping so it could be "merged" #}
FDO_DISTRIBUTION_PACKAGES: '{{image.packages | sort | join(" ")}}'
{% if "script" in image %}
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/{{image["script"]}}'
{% endif %}
{% endfor -%} {%- endfor %}
{% from 'include.functions.jinja' import base_job_to_use_image with context %}
###
# Container usage base jobs
{% for distro in distributions -%} {%- for image in distro.images %}
# Base for using {{ image_name_for_comment(distro, image) }} image
{{ base_job_to_use_image(distro, image) }}:
extends:
- .monado.variables.{{ image_name(distro, image) }}
- .fdo.{{ "suffixed" if "repo_suffix" in image else "distribution" }}-image@{{distro.name}} # from ci-templates
- .build-rules
{% endfor -%} {%- endfor %}

View file

@ -0,0 +1,29 @@
{#
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2023 Collabora, Ltd. and the Monado contributors
#
# This file is not used directly to generate its own output: it is included by .gitlab-ci.yml.jinja
#}
{# Macro to compute job name to extend to use image given a package we want#}
{% macro base_job_to_use_image_containing(package) %}
{% for distro in distributions -%} {%- for image in distro.images if package in image.packages %}
{{ base_job_to_use_image(distro, image) if loop.first }}
{% endfor -%} {%- endfor %}
{% endmacro -%}
{# Macro to compute a part of a job name, etc. for a distro and image #}
{% macro image_name(distro, image) -%}
{{ distro.name }}
{%- if "codename" in image %}:{{ image.codename }}{%- endif -%}
{%- endmacro -%}
{# Macro to compute job name to extend to use image given distro and image objects#}
{% macro base_job_to_use_image(distro, image) %}.monado.image.{{ image_name(distro, image) }}{% endmacro -%}
{# Macro to compute a part of a comment describing a distro and image #}
{% macro image_name_for_comment(distro, image) %}
{{ distro.name | capitalize }}
{%- if "codename" in image %} {{ image.codename }}{%- endif -%}
{%- endmacro -%}

View file

@ -0,0 +1,79 @@
# {#- included by .gitlab-ci.yml.jinja #}
# {#- SPDX-License-Identifier: CC0-1.0 #}
# {#- SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors #}
###
# Windows container-related jobs (prep and usage)
.monado.common_variables.windows:vs2022:
inherit:
default: false
variables:
MONADO_WIN_BASE_TAG: "20230422.0"
MONADO_WIN_MAIN_TAG: "20230422.0"
MONADO_BASE_IMAGE_PATH: "win2022/vs2022_base"
MONADO_MAIN_IMAGE_PATH: "win2022/vs2022"
.monado.variables.windows:vs2022:
inherit:
default: false
extends:
- .monado.common_variables.windows:vs2022
variables:
MONADO_IMAGE_PATH: "$MONADO_MAIN_IMAGE_PATH"
FDO_DISTRIBUTION_TAG: "$MONADO_WIN_MAIN_TAG"
MONADO_IMAGE: "$CI_REGISTRY_IMAGE/$MONADO_IMAGE_PATH:$FDO_DISTRIBUTION_TAG"
MONADO_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MONADO_IMAGE_PATH:$FDO_DISTRIBUTION_TAG"
# Shared container-building job
.monado.windows.container_prep:
inherit:
default: false
tags:
- windows
- "2022"
- shell
variables:
GIT_STRATEGY: fetch
extends:
- .container-rules
stage: container_prep
script:
- |
.gitlab-ci\windows\monado_container.ps1 -RegistryUri "$CI_REGISTRY" -RegistryUsername "$CI_REGISTRY_USER" -UserImage "$MONADO_IMAGE" -UpstreamImage "$MONADO_UPSTREAM_IMAGE" -Dockerfile "$DOCKERFILE" -BaseImage "$MONADO_BASE_IMAGE" -BaseUpstreamImage "$MONADO_UPSTREAM_BASE_IMAGE" -Verbose
# This container just installs Visual C++ Build Tools.
win:container_prep:base:
extends:
- .monado.windows.container_prep
- .monado.common_variables.windows:vs2022
variables:
DOCKERFILE: Dockerfile.vs2022
MONADO_IMAGE_PATH: ${MONADO_BASE_IMAGE_PATH}
FDO_DISTRIBUTION_TAG: "$MONADO_WIN_BASE_TAG"
MONADO_IMAGE: "$CI_REGISTRY_IMAGE/$MONADO_IMAGE_PATH:$FDO_DISTRIBUTION_TAG"
MONADO_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MONADO_IMAGE_PATH:$FDO_DISTRIBUTION_TAG"
# This container adds other deps
win:container_prep:
extends:
- .monado.windows.container_prep
- .monado.variables.windows:vs2022
needs:
- win:container_prep:base
variables:
DOCKERFILE: Dockerfile.build
MONADO_BASE_IMAGE: "$CI_REGISTRY_IMAGE/$MONADO_BASE_IMAGE_PATH:$MONADO_WIN_BASE_TAG"
MONADO_UPSTREAM_BASE_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MONADO_BASE_IMAGE_PATH:$MONADO_WIN_BASE_TAG"
# Base job to use a Windows build container
.monado.image.windows:
tags:
- windows
- "2022"
- docker
extends:
- .monado.variables.windows:vs2022
- .build-rules
image: $MONADO_IMAGE

View file

@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Copyright 2022, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
#{# ignore the warning, this is actually the template to edit. #}#
#######################################################
# GENERATED - DO NOT EDIT #
# see .gitlab-ci/install-android-sdk.sh.jinja instead #
#######################################################
#{#
Please run the following after editing:
make -f .gitlab-ci/ci-scripts.mk
#}#
# Partially inspired by https://about.gitlab.com/blog/2018/10/24/setting-up-gitlab-ci-for-android-projects/
{% for distro in distributions -%} {%- for image in distro.images if "android_compile_sdk" in image %}
set -eo pipefail
VERSION={{image.android_cli_tools}}
ROOT=${ROOT:-/opt/android-sdk}
ANDROID_COMPILE_SDK=${ANDROID_COMPILE_SDK:-{{image.android_compile_sdk}}}
ANDROID_BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-{{image.android_build_tools}}}
mkdir -p "$ROOT"
FN=commandlinetools-linux-${VERSION}_latest.zip
wget https://dl.google.com/android/repository/$FN
unzip $FN -d "$ROOT/extract"
mkdir -p "$ROOT/cmdline-tools"
mv "$ROOT/extract/cmdline-tools/" "$ROOT/cmdline-tools/latest/"
mv "$ROOT/extract/" "$ROOT/cmdline-tools/"
SDKMANAGER=$ROOT/cmdline-tools/latest/bin/sdkmanager
echo "Installing the Android compile SDK platform android-${ANDROID_COMPILE_SDK}"
echo y | $SDKMANAGER "platforms;android-${ANDROID_COMPILE_SDK}" >> /dev/null
echo "Installing the Android platform tools"
echo y | $SDKMANAGER "platform-tools" >> /dev/null
echo "Installing the Android build tools ${ANDROID_BUILD_TOOLS}"
echo y | $SDKMANAGER "build-tools;${ANDROID_BUILD_TOOLS}" >> /dev/null
set +o pipefail
yes | $SDKMANAGER --licenses
set -o pipefail
{% endfor -%} {%- endfor %}

View file

@ -0,0 +1,48 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
{# ignore the warning, this is actually the template to edit. #}
###############################################
# GENERATED - DO NOT EDIT #
# see .gitlab-ci/reprepro.sh.template instead #
###############################################
{#
Please run the following after editing:
ci-fairy generate-template --config .gitlab-ci/config.yml .gitlab-ci/reprepro.sh.template > .gitlab-ci/reprepro.sh
#}
set -euo pipefail
# Convince gnupg to work properly in CI
echo "Import and cache the GPG key"
mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
cp .gitlab-ci/gpg.conf .gitlab-ci/gpg-agent.conf ~/.gnupg
echo RELOADAGENT | gpg-connect-agent
gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase "${MONADO_GPG_PASSPHRASE}" --import "${MONADO_GPG_SECRET_KEY}"
echo "Prepare reprepro config"
mkdir -p repo/conf
# Substitute in the GPG fingerprint into the repository config.
# This file is itself generated with ci-fairy.
cat .gitlab-ci/distributions | envsubst > repo/conf/distributions
echo "reprepro config file:"
echo "---------------------"
cat repo/conf/distributions
echo "---------------------"
# For each distro, sign the changes file and add it to the repo.
{% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %}
# {{ image.codename }}
if [ -f "incoming/{{image.codename}}.distro" ]; then
VERSION=$(cat incoming/{{image.codename}}.distro)
echo "Signing and processing {{image.codename}}: ${VERSION}"
debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes"
reprepro -V --ignore=wrongdistribution -b repo include {{image.codename}} "incoming/monado_${VERSION}_amd64.changes"
else
echo "Skipping {{image.codename}} - no artifact found"
fi
{% endfor -%} {%- endfor %}

View file

@ -1,7 +0,0 @@
#!/bin/bash
# Copyright 2018-2020, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
(
cd $(dirname $0)
bash ./build-openxr-openhmd.sh
)

View file

@ -1,5 +0,0 @@
#!/bin/bash
# Copyright 2021, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
# Nothing really needed.

View file

@ -0,0 +1,17 @@
# Copyright 2019-2022, Mesa contributors
# Copyright 2022, Collabora, Ltd.
# SPDX-License-Identifier: MIT
# Based on https://gitlab.freedesktop.org/mesa/mesa/-/blob/8396df5ad90aeb6ab2267811aba2187954562f81/.gitlab-ci/windows/Dockerfile_build
# escape=`
ARG base_image
FROM ${base_image}
# Make sure any failure in PowerShell scripts is fatal
SHELL ["powershell", "-ExecutionPolicy", "RemoteSigned", "-Command", "$ErrorActionPreference = 'Stop';"]
ENV ErrorActionPreference='Stop'
COPY "monado_deps_build.ps1" "C:/"
RUN "C:/monado_deps_build.ps1"

View file

@ -0,0 +1,16 @@
# Copyright 2019-2022, Mesa contributors
# Copyright 2022, Collabora, Ltd.
# SPDX-License-Identifier: MIT
# Based on https://gitlab.freedesktop.org/mesa/mesa/-/blob/8396df5ad90aeb6ab2267811aba2187954562f81/.gitlab-ci/windows/Dockerfile_build
# escape=`
# FROM mcr.microsoft.com/windows:2004
FROM mcr.microsoft.com/windows/server:ltsc2022
# Make sure any failure in PowerShell scripts is fatal
SHELL ["powershell", "-ExecutionPolicy", "RemoteSigned", "-Command", "$ErrorActionPreference = 'Stop';"]
ENV ErrorActionPreference='Stop'
COPY "monado_deps_vs2022.ps1" "C:\\"
RUN "powershell C:\\monado_deps_vs2022.ps1"

View file

@ -0,0 +1,70 @@
# Native Windows GitLab CI builds
<!--
# Copyright 2019-2022, Mesa contributors
# Copyright 2022, Collabora, Ltd.
# SPDX-License-Identifier: MIT
Based on https://gitlab.freedesktop.org/mesa/mesa/-/blob/8396df5ad90aeb6ab2267811aba2187954562f81/.gitlab-ci/windows/README.md
-->
We are using the same basic approach to Windows CI building as Mesa, just as we
do on Linux. See
<https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/.gitlab-ci/windows> for
the details there. The following is the Mesa readme, lightly modified to fit
Monado.
Unlike Linux, Windows cannot reuse the freedesktop ci-templates as they exist
as we do not have Podman, Skopeo, or even Docker-in-Docker builds available
under Windows.
We still reuse the same model: build a base container with the core operating
system and infrequently-changed build dependencies, then execute Monado builds
only inside that base container. This is open-coded in PowerShell scripts.
## Base container build
The base container build jobs execute the `monado_container.ps1` script which
reproduces the ci-templates behaviour. It looks for the registry image in
the user's namespace, and exits if found. If not found, it tries to copy
the same image tag from the upstream Monado repository. If that is not found,
the image is rebuilt inside the user's namespace.
The rebuild executes `docker build` which calls `monado_deps_*.ps1` inside the
container to fetch and install all build dependencies. This includes Visual
Studio Build Tools (downloaded from Microsoft, under the license which
allows use by open-source projects), and other build tools from Scoop.
(These are done as two separate jobs to allow "resuming from the middle".)
This job is executed inside a Windows shell environment directly inside the
host, without Docker.
## Monado build
The Monado build runs inside the base container, executing `mesa_build.ps1`.
This simply compiles Monado using CMake and Ninja, executing the build and
unit tests.
## Local testing
To try these scripts locally, you need this done once, rebooting after they are complete:
```pwsh
scoop install sudo
sudo Add-MpPreference -ExclusionProcess dockerd.exe
sudo Add-MpPreference -ExclusionProcess docker.exe
winget install stevedore
sudo Add-MpPreference -ExclusionPath c:\ProgramData\docker
```
then this, done when you want to test:
```pwsh
docker context use desktop-windows
```
before doing your normal `docker build .`, etc. (It may still be very slow
despite the virus scanning exclusions.)
If you're having issues accessing the network, see this comment's instructions:
<https://github.com/docker/for-win/issues/9847#issuecomment-832674649>

View file

@ -0,0 +1,97 @@
# Copyright 2019-2022, Mesa contributors
# Copyright 2022, Collabora, Ltd.
# SPDX-License-Identifier: MIT
# Based on https://gitlab.freedesktop.org/mesa/mesa/-/blob/8396df5ad90aeb6ab2267811aba2187954562f81/.gitlab-ci/windows/mesa_build.ps1
[CmdletBinding()]
param (
# Should we install the project?
[Parameter()]
[switch]
$Install = $false,
# Should we package the project?
[Parameter()]
[switch]
$Package = $false,
# Should we run the test suite?
[Parameter()]
[switch]
$RunTests = $false
)
$ErrorActionPreference = 'Stop'
$env:PYTHONUTF8 = 1
Get-Date
Write-Host "Compiling Monado"
$sourcedir = (Resolve-Path "$PSScriptRoot/../..")
$builddir = Join-Path $sourcedir "build"
$installdir = Join-Path $sourcedir "install"
$vcpkgdir = "c:\vcpkg"
$toolchainfile = Join-Path $vcpkgdir "scripts/buildsystems/vcpkg.cmake"
Remove-Item -Recurse -Force $installdir -ErrorAction SilentlyContinue
Write-Output "builddir:$builddir"
Write-Output "installdir:$installdir"
Write-Output "sourcedir:$sourcedir"
Write-Output "toolchainfile:$toolchainfile"
# $installPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -version 17 -property installationpath
# Write-Information "vswhere.exe installPath: $installPath"
# if (!$installPath) {
# throw "Could not find VS2022 using vswhere!"
# }
$installPath = "C:\BuildTools"
Write-Output "installPath: $installPath"
# We have to clear this because some characters in a commit message may confuse cmd/Enter-VsDevShell.
$env:CI_COMMIT_DESCRIPTION = ""
$env:CI_COMMIT_MESSAGE = ""
Import-Module (Join-Path $installPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64 -no_logo -host_arch=amd64'
$ErrorActionPreference = 'Stop'
Push-Location $sourcedir
$cmakeArgs = @(
"-S"
"."
"-B"
"$builddir"
"-GNinja"
"-DCMAKE_BUILD_TYPE=RelWithDebInfo"
"-DCMAKE_TOOLCHAIN_FILE=$toolchainfile"
"-DCMAKE_INSTALL_PREFIX=$installdir"
"-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON"
)
cmake @cmakeArgs
if (!$?) {
throw "cmake generate failed!"
}
Write-Information "Building"
cmake --build $builddir
if (!$?) {
throw "cmake build failed!"
}
if ($RunTests) {
Write-Information "Running tests"
cmake --build $builddir --target test
}
if ($Install) {
Write-Information "Installing"
cmake --build $builddir --target install
}
if ($Package) {
Write-Information "Packaging"
cmake --build $builddir --target package
}

View file

@ -0,0 +1,213 @@
# Copyright 2019-2022, Mesa contributors
# Copyright 2022, Collabora, Ltd.
# SPDX-License-Identifier: MIT
# Based on https://gitlab.freedesktop.org/mesa/mesa/-/blob/8396df5ad90aeb6ab2267811aba2187954562f81/.gitlab-ci/windows/mesa_container.ps1
# Implements the equivalent of ci-templates container-ifnot-exists, using
# Docker directly as we don't have buildah/podman/skopeo available under
# Windows, nor can we execute Docker-in-Docker
[CmdletBinding()]
param (
# Address for container registry
[Parameter()]
[string]
$RegistryUri,
# Username for container registry
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]
$RegistryUsername,
# The path of the image for this user's fork
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]
$UserImage,
# The path of the image in the upstream registry
[Parameter()]
[string]
$UpstreamImage,
# Dockerfile to build
[Parameter()]
[string]
$Dockerfile = "Dockerfile",
# Base image to use for this container, if any
[Parameter()]
[string]
$BaseImage,
# Base image to use for this container, from the upstream repo, if any
[Parameter()]
[string]
$BaseUpstreamImage
)
$RegistryPassword = "$env:CI_REGISTRY_PASSWORD"
$CommonDockerArgs = @(
"--config"
"windows-docker.conf"
)
$ErrorActionPreference = 'Stop'
# Returns $true on a zero error code
# If $AllowFailure is not set, throws on a nonzero exit code
function Start-Docker {
param (
# Should we just return the exit code on failure instead of throwing?
[Parameter()]
[switch]
$AllowFailure = $false,
# Should we try to log out before throwing in case of an error?
[Parameter()]
[switch]
$LogoutOnFailure = $false,
# What arguments should be passed to docker (besides the config)
[Parameter(Mandatory = $true)]
[string[]]
$ArgumentList
)
$DockerArgs = $CommonDockerArgs + $ArgumentList
Write-Verbose ("Will run docker " + ($DockerArgs -join " "))
$proc = Start-Process -FilePath "docker" -ArgumentList $DockerArgs -NoNewWindow -PassThru -WorkingDirectory "$PSScriptRoot" -Wait
if ($proc.ExitCode -eq 0) {
Write-Verbose "Success!"
return $true
}
if (!$AllowFailure) {
Write-Error ($ArgumentList[0] + " failed")
if ($LogoutOnFailure) {
Write-Host "Logging out"
Start-Process -FilePath "docker" -ArgumentList ($CommonDockerArgs + @("logout", "$RegistryUri")) `
-NoNewWindow -PassThru -WorkingDirectory "$PSScriptRoot" -Wait
}
throw ("docker " + $ArgumentList[0] + " invocation failed")
}
return $false
}
# Returns $true if the $Image exists (whether or not we had to copy $UpstreamImage)
function Test-Image {
param (
# Image to look for
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
$Image,
# Equivalent image from the upstream repo, if any
[Parameter()]
[string]
$UpstreamImage
)
# if the image already exists, great
Write-Verbose "Looking for $Image"
# $pullResult = Start-Docker -AllowFailure -ArgumentList ("pull", "$Image")
docker @CommonDockerArgs pull "$Image"
if ($?) {
Write-Host "Image $UserImage exists"
return $true
}
if (!$UpstreamImage) {
Write-Host "Cannot find $Image"
return $false
}
# if it's only upstream, copy it
Write-Host "Cannot find $Image, looking for upstream $UpstreamImage"
docker @CommonDockerArgs pull "$UpstreamImage"
if ($?) {
Write-Host "Found upstream image, copying image from upstream $UpstreamImage to user $Image"
Start-Docker -LogoutOnFailure -ArgumentList ("tag", "$UpstreamImage", "$Image")
Start-Docker -LogoutOnFailure -ArgumentList ("push", "$Image")
return $true
}
Write-Host "Cannot find $Image nor $UpstreamImage"
return $false
}
if ($BaseImage -and (!$BaseUpstreamImage)) {
$BaseUpstreamImage = $BaseImage
}
Write-Host "Will log in to $RegistryUri as $RegistryUsername"
Write-Host "Will check for image $UserImage - if it does not exist but $UpstreamImage does, we copy that one, otherwise we need to build it."
if ($BaseImage) {
Write-Host "This image builds on $BaseImage so we will check for it."
if ($BaseUpstreamImage) {
Write-Host "If it is missing but $BaseUpstreamImage exists, we copy that one. If both are missing, we error out."
}
else {
Write-Host "If it is missing, we error out."
}
}
if ($RegistryPassword) {
# Start-Docker -ArgumentList ("login", "-u", "$RegistryUsername", "--password-stdin", "$RegistryPassword", "$RegistryUri")
$loginProc = Start-Process -FilePath "docker" -ArgumentList ($CommonDockerArgs + @("login", "-u", "$RegistryUsername", "--password", "$RegistryPassword", "$RegistryUri")) `
-NoNewWindow -PassThru -WorkingDirectory "$PSScriptRoot" -Wait
if ($loginProc.ExitCode -ne 0) {
throw "docker login failed"
}
}
else {
Write-Host "Skipping docker login, password not available"
}
# if the image already exists, don't rebuild it
$imageResult = Test-Image -Image $UserImage -UpstreamImage $UpstreamImage
if ($imageResult) {
Write-Host "User image $UserImage already exists; not rebuilding"
Start-Docker -ArgumentList ("logout", "$RegistryUri")
Exit 0
}
# do we need a base image?
if ($BaseImage) {
$baseImageResult = Test-Image -Image "$BaseImage" -UpstreamImage "$BaseUpstreamImage"
if (!$baseImageResult) {
throw "Could not find base image: neither '$BaseImage' nor '$BaseUpstreamImage' exist."
}
}
Write-Host "No image found at $UserImage or $UpstreamImage; rebuilding, this may take a while"
$DockerBuildArgs = @(
"build"
"--no-cache"
"-t"
"$UserImage"
"-f"
"$Dockerfile"
)
if ($BaseImage) {
$DockerBuildArgs += @(
"--build-arg"
"base_image=$BaseImage"
)
}
$DockerBuildArgs += "."
Start-Docker -LogoutOnFailure -ArgumentList (, $DockerBuildArgs)
Get-Date
Write-Host "Done building image, now pushing $UserImage"
Start-Docker -LogoutOnFailure -ArgumentList ("push", "$UserImage")
if ($RegistryPassword) {
Start-Docker -ArgumentList ("logout", "$RegistryUri")
}
else {
Write-Host "Skipping docker logout, password not available so we did not login"
}

View file

@ -0,0 +1,64 @@
# Copyright 2019-2022, Mesa contributors
# Copyright 2022, Collabora, Ltd.
# SPDX-License-Identifier: MIT
# Based on https://gitlab.freedesktop.org/mesa/mesa/-/blob/8396df5ad90aeb6ab2267811aba2187954562f81/.gitlab-ci/windows/mesa_deps_build.ps1
$VulkanRTVersion = "1.3.211.0"
# Download new TLS certs from Windows Update
Get-Date
Write-Host "Updating TLS certificate store"
$certdir = (New-Item -ItemType Directory -Name "_tlscerts")
certutil -syncwithWU "$certdir"
Foreach ($file in (Get-ChildItem -Path "$certdir\*" -Include "*.crt")) {
Import-Certificate -FilePath $file -CertStoreLocation Cert:\LocalMachine\Root
}
Remove-Item -Recurse -Path $certdir
Get-Date
Write-Host "Installing runtime redistributables"
Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile "C:\vcredist_x64.exe" -UseBasicParsing
Start-Process -NoNewWindow -Wait "C:\vcredist_x64.exe" -ArgumentList "/install /passive /norestart /log out.txt"
if (!$?) {
Write-Host "Failed to install vc_redist"
Exit 1
}
Remove-Item "C:\vcredist_x64.exe" -Force
Get-Date
Write-Host "Installing Vulkan runtime components"
$VulkanInstaller = "C:\VulkanRTInstaller.exe"
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$VulkanRTVersion/windows/VulkanRT-$VulkanRTVersion-Installer.exe" -OutFile "$VulkanInstaller"
Start-Process -NoNewWindow -Wait "$VulkanInstaller" -ArgumentList "/S"
if (!$?) {
Write-Host "Failed to install Vulkan runtime components"
Exit 1
}
Remove-Item "$VulkanInstaller" -Force
Get-Date
Write-Host "Installing Scoop"
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-WebRequest get.scoop.sh -OutFile install.ps1
.\install.ps1 -RunAsAdmin
scoop install git
Get-Date
Write-Host "Installing things from Scoop"
scoop install cmake
scoop install python
scoop install vulkan
scoop install ninja
Get-Date
Write-Host "Preparing vcpkg"
Set-Location C:\
git clone https://github.com/microsoft/vcpkg.git
Set-Location vcpkg
./bootstrap-vcpkg.bat -DisableMetrics
Get-Date
Write-Host "Installing some base deps from vcpkg"
./vcpkg.exe install cjson:x64-windows eigen3:x64-windows wil:x64-windows pthreads:x64-windows glslang:x64-windows libusb:x64-windows hidapi:x64-windows sdl2[base,vulkan]:x64-windows
Remove-Item -Recurse -Path downloads
Remove-Item -Recurse -Path buildtrees

View file

@ -0,0 +1,43 @@
# Copyright 2019-2022, Mesa contributors
# Copyright 2022, Collabora, Ltd.
# SPDX-License-Identifier: MIT
# Based on https://gitlab.freedesktop.org/mesa/mesa/-/blob/8396df5ad90aeb6ab2267811aba2187954562f81/.gitlab-ci/windows/mesa_deps_vs2019.ps1
# we want more secure TLS 1.2 for most things
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
# VS17.x is 2022
$msvc_url = 'https://aka.ms/vs/17/release/vs_buildtools.exe'
Get-Date
Write-Host "Downloading Visual Studio 2022 build tools"
Invoke-WebRequest -Uri $msvc_url -OutFile C:\vs_buildtools.exe -UseBasicParsing
Get-Date
Write-Host "Installing Visual Studio"
$vsInstallerArgs = @(
"--wait"
"--quiet"
"--norestart"
"--nocache"
"--installPath"
"C:\BuildTools"
"--add"
"Microsoft.VisualStudio.Component.VC.CoreBuildTools"
"--add"
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core"
"--add"
"Microsoft.VisualStudio.Component.Windows10SDK"
"--add"
"Microsoft.VisualStudio.Component.Windows11SDK.22000"
"--add"
"Component.Microsoft.Windows.CppWinRT"
"--add"
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
)
Start-Process -NoNewWindow -Wait C:\vs_buildtools.exe -ArgumentList $vsInstallerArgs
if (!$?) {
Write-Host "Failed to install Visual Studio tools"
Exit 1
}
Remove-Item C:\vs_buildtools.exe -Force

43
.mailmap Normal file
View file

@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: 2023, Monado contributors
#
# SPDX-License-Identifier: CC0-1.0
#
# See mailmap docs: https://git-scm.com/docs/gitmailmap
# Test with git shortlog --summary --email
# Keep sorted for easier editing and smaller diffs
# Only extend to fix names or unify duplicate entries
0y8w1x <Joseph.Albers@outlook.de>
0y8w1x <Joseph.Albers@outlook.de> <joseph.albers@outlook.de>
Antonio Ospite <antonio.ospite@collabora.com>
Antonio Ospite <antonio.ospite@collabora.com> <aospite_collabora@magicleap.com>
Bjorn Swenson <bjorn.swenson@collabora.com>
Bjorn Swenson <bjorn.swenson@collabora.com> <bjorn@collabora.com>
Christoph Haag <christoph.haag@collabora.com>
Christoph Haag <christoph.haag@collabora.com> <haagch+gitlab@frickel.club>
Daniel Willmott <web@dan-w.com>
Fernando Velazquez Innella <finnella@magicleap.com>
Jakob Bornecrantz <jakob@collabora.com>
Jakob Bornecrantz <jakob@collabora.com> <jakob@jakob-zen-elite.cbg.collabora.co.uk>
Jakob Bornecrantz <jakob@collabora.com> <wallbraker@gmail.com>
Korcan Hussein <korcan.hussein@collabora.com>
Korcan Hussein <korcan.hussein@collabora.com> <64199710+korejan@users.noreply.github.com>
Korcan Hussein <korcan.hussein@collabora.com> <korcan_h@hotmail.com>
Mateo de Mayo <mateo.demayo@collabora.com>
Mateo de Mayo <mateo.demayo@collabora.com> <mateodemayo@gmail.com>
Moshi Turner <mosesturner@protonmail.com>
Moshi Turner <mosesturner@protonmail.com> <moses@collabora.com>
Moshi Turner <moshi@arcturus.industries>
Nima01 <nima_zero_one@protonmail.com>
Nova King <technobaboo@gmail.com>
Pete Black <pete.black@collabora.com>
Rylie Pavlik <rylie.pavlik@collabora.com>
Rylie Pavlik <rylie.pavlik@collabora.com> <ryan.pavlik@collabora.com>
Rylie Pavlik <rylie.pavlik@collabora.com> <ryan.pavlik@gmail.com>
Simon Zeni <simon.zeni@collabora.com>
Simon Zeni <simon.zeni@collabora.com> <simon@bl4ckb0ne.ca>
Weijie Wang <quic_weijiew@quicinc.com>
Weijie Wang <quic_weijiew@quicinc.com> <weijiew@qti.qualcomm.com>
Zhibin Wang <quic_zhibinw@quicinc.com>
Zhibin Wang <quic_zhibinw@quicinc.com> <zhibin@codeaurora.org>
samuel degrande <samuel.degrande@univ-lille.fr>

View file

@ -10,11 +10,18 @@ Files: doc/changes/drivers/*
doc/changes/xrt/*
doc/changes/auxiliary/*
doc/changes/compositor/*
doc/changes/doc/*
doc/changes/big/*
doc/changes/tracking/*
Copyright: 2020-2021, Collabora, Ltd. and the Monado contributors
License: CC0-1.0
Comment: Prevents needing a license header per fragment between releases.
Files: doc/doxygen-awesome-css/*
Copyright: 2021-2023, jothepro
License: MIT
Comment: SPDX-License-Identifier missing.
Files: src/external/cjson/*
Copyright: 2009-2017, Dave Gamble and cJSON contributors
License: MIT
@ -80,14 +87,45 @@ Comment: SPDX-License-Identifier missing.
Files: src/external/glad/include/glad/egl.h
Copyright: 2013-2020, The Khronos Group, Inc.
License: Apache-2.0
Comment: This is generated from the specification XML (licensed as above) by GLAD2.
Comment: This is generated from the specification XML (licensed as indicated earlier) by GLAD2:
https://github.com/KhronosGroup/EGL-Registry/blob/main/api/egl.xml
Specification copyright statement last updated 2020 though file itself updated more recently.
Files: src/external/glad/include/glad/gl.h
Copyright: 2013-2020, The Khronos Group, Inc.
Copyright: 2013-2022, The Khronos Group, Inc.
License: Apache-2.0
Comment: This is generated from the specification XML (licensed as above) by GLAD2.
Comment: This is generated from the specification XML (licensed as indicated earlier) by GLAD2:
https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/main/xml/gl.xml
Specification copyright statement last updated 2020 though file itself updated more recently.
Files: src/external/glad/include/glad/glx.h
Copyright: 2013-2022, The Khronos Group, Inc.
License: Apache-2.0
Comment: This is generated from the specification XML (licensed as indicated earlier) by GLAD2:
https://github.com/KhronosGroup/OpenGL-Registry/blob/main/xml/glx.xml
Files: src/external/glad/include/glad/wgl.h
Copyright: 2013-2022, The Khronos Group, Inc.
License: Apache-2.0
Comment: This is generated from the specification XML (licensed as indicated earlier) by GLAD2:
https://github.com/KhronosGroup/OpenGL-Registry/blob/main/xml/wgl.xml
Files: src/external/glad/src/*
Copyright: 2013-2020, David Herberth
Copyright: 2013-2022, David Herberth
License: MIT
Comment: SPDX-License-Identifier missing.
Files: src/external/nanopb/*
Copyright: 2011-2022, Petteri Aimonen
License: Zlib
Comment: License information global from repository.
Files: src/external/tracy/*
Copyright: 2017-2022, Bartosz Taudul
License: BSD-3-Clause
Comment: SPDX-License-Identifier missing.
Files: src/external/valve-file-vdf/*
Copyright: 2016-2023, Matthias Moeller
License: MIT
Comment: SPDX-License-Identifier missing.

View file

@ -1,16 +1,44 @@
# Copyright 2018-2021, Collabora, Ltd.
# Copyright 2018-2024, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
cmake_minimum_required(VERSION 3.10.2)
project(XRT VERSION 21.0.0)
project(
XRT
VERSION 21.0.0
LANGUAGES C CXX
DESCRIPTION "Monado(XRT) by Collabora et al"
)
# CMake 3.11 introduced CMP0072 - Prefer GLVND
if(POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
endif()
option(XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH "Use the absolute path to the runtime in the installed manifest, rather than a bare filename." ON)
option(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME "Make Monado the default OpenXR runtime on install" ON)
set(_default_absolute ON)
if(WIN32)
set(_default_absolute OFF)
endif()
option(
XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH
"Use the absolute path to the runtime in the installed manifest, rather than a bare filename."
OFF
)
option(
XRT_OPENXR_INSTALL_MANIFEST_RELATIVE_RUNTIME_PATH
"If XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH is off, use a relative path from the manifest to the runtime."
ON
)
if(NOT WIN32 AND NOT ANDROID)
option(
XRT_OPENXR_INSTALL_ACTIVE_RUNTIME
"Make Monado the system-wide default OpenXR runtime on install (requires superuser permissions)"
OFF
)
endif()
# We use C11
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
# We use C++17
set(CMAKE_CXX_STANDARD 17)
@ -24,11 +52,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
###
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/sanitizers")
include(CMakeDependentOption)
include(OptionWithDeps)
include(SPIR-V)
include(GNUInstallDirs)
include(GetGitRevisionDescription)
git_describe(GIT_DESC "--always")
if(NOT GIT_DESC)
include(GetGitRevisionDescription)
git_describe(GIT_DESC "--always")
endif()
if(NOT ${CMAKE_VERSION} VERSION_LESS 3.9)
include(CheckIPOSupported)
check_ipo_supported(RESULT HAS_IPO)
@ -42,8 +72,11 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.12)
else()
find_program(PYTHON_EXECUTABLE python3)
if(PYTHON_EXECUTABLE MATCHES "WindowsApps")
# If you hit this error, you will have to install Python 3 or try harder to tell CMake where it is.
message(FATAL_ERROR "Found WindowsApps alias for Python. Make sure Python3 is installed, then choose 'Manage App Execution Aliases' in Start and disable the aliases for Python.")
# If you receive this error, you will have to install Python 3 or try harder to tell CMake where it is.
message(
FATAL_ERROR
"Found WindowsApps alias for Python. Make sure Python3 is installed, then choose 'Manage App Execution Aliases' in Start and disable the aliases for Python."
)
endif()
endif()
@ -51,10 +84,21 @@ endif()
# which the config file for a 3.x says it's not compatible with.
find_package(Eigen3 3 REQUIRED)
find_package(Vulkan MODULE)
find_package(EGL MODULE)
find_package(HIDAPI MODULE)
find_package(bluetooth MODULE)
find_package(OpenHMD MODULE)
find_package(OpenCV COMPONENTS core calib3d highgui imgproc imgcodecs features2d video CONFIG)
find_package(
OpenCV
COMPONENTS
core
calib3d
highgui
imgproc
imgcodecs
features2d
video
CONFIG
)
find_package(Libusb1 MODULE)
find_package(JPEG MODULE)
find_package(realsense2 CONFIG)
@ -62,37 +106,52 @@ find_package(depthai CONFIG)
find_package(SDL2 CONFIG)
find_package(ZLIB MODULE)
find_package(cJSON MODULE)
find_package(Systemd MODULE)
find_package(OpenGLES MODULE COMPONENTS V3)
find_package(LeapV2 MODULE)
find_package(LeapSDK 5 CONFIG)
find_package(ONNXRuntime MODULE)
find_package(Percetto MODULE)
if(NOT ANDROID)
if(NOT WIN32)
find_package(EGL MODULE)
find_package(Percetto MODULE)
find_package(Systemd MODULE)
find_package(OpenGLES MODULE COMPONENTS V3)
find_library(RT_LIBRARY rt)
endif()
if(NOT ANDROID AND NOT MSVC)
find_package(PkgConfig MODULE)
endif()
if(ANDROID)
find_library(ANDROID_LIBRARY android)
find_library(ANDROID_LOG_LIBRARY log)
endif()
if(MSVC)
find_package(wil CONFIG)
find_library(D3D11_LIBRARY d3d11)
find_library(D3D12_LIBRARY d3d12)
find_library(DXGI_LIBRARY dxgi)
find_library(WINDOWSAPP_LIBRARY WindowsApp)
endif()
#https://github.com/arsenm/sanitizers-cmake
find_package(Sanitizers MODULE)
add_library(xrt-pthreads INTERFACE)
if(WIN32)
if(MSVC)
find_package(pthreads_windows REQUIRED)
target_link_libraries(xrt-pthreads INTERFACE PThreads4W::PThreads4W_CXXEXC)
else()
set(CMAKE_THREAD_PREFER_PTHREAD ON)
find_package(Threads)
target_link_libraries(xrt-pthreads INTERFACE Threads::Threads)
target_compile_definitions(xrt-pthreads INTERFACE _GNU_SOURCE)
endif()
if(PKGCONFIG_FOUND AND NOT ANDROID)
# @TODO Turn into a find_package LIBUVC file.
pkg_check_modules(LIBUVC libuvc)
# @TODO Turn into a find_package FFMPEG file.
pkg_check_modules(FFMPEG libavcodec)
endif()
find_package(OpenGL)
set(OPENGL_WITHOUT_GLX_FOUND ${OPENGL_FOUND})
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(XRT_HAVE_LINUX YES)
# Compositor backend
@ -108,75 +167,240 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
pkg_search_module(WAYLAND wayland-client)
pkg_search_module(WAYLAND_SCANNER wayland-scanner)
pkg_search_module(WAYLAND_PROTOCOLS wayland-protocols)
pkg_search_module(LIBDRM libdrm)
pkg_search_module(LIBDRM IMPORTED_TARGET libdrm)
endif()
find_package(OpenGL COMPONENTS GLX)
pkg_search_module(DBUS dbus-1)
pkg_search_module(LIBBSD libbsd)
endif()
pkg_check_modules(GST
gstreamer-1.0
gstreamer-app-1.0
gstreamer-video-1.0
)
if(XRT_HAVE_LINUX OR MINGW)
pkg_check_modules(GST gstreamer-1.0 gstreamer-app-1.0 gstreamer-video-1.0)
pkg_check_modules(SURVIVE IMPORTED_TARGET survive)
endif()
# Find openvr library
find_library(OPENVR_LIBRARIES NAMES openvr_api)
if(OPENVR_LIBRARIES)
set(OPENVR_FOUND on)
message(STATUS "Found OpenVR: " ${OPENVR_LIBRARIES})
else()
find_package(OpenGL)
set(OPENVR_FOUND off)
message(STATUS "OpenVR not found")
endif()
find_library(RT_LIBRARY rt)
if(ANDROID)
find_library(ANDROID_LIBRARY android)
find_library(ANDROID_LOG_LIBRARY log)
endif()
# Find a external SLAM implementation
set(EXTERNAL_SLAM_SYSTEMS kimera_vio)
foreach(slam_system IN LISTS EXTERNAL_SLAM_SYSTEMS)
if(PKGCONFIG_FOUND)
pkg_check_modules(${slam_system} ${slam_system})
endif()
if(${slam_system}_FOUND)
set(SLAM ON)
set(SLAM_NAME ${slam_system})
set(SLAM_LIBRARIES ${${slam_system}_LIBRARIES})
set(SLAM_INCLUDE_DIRS ${${slam_system}_INCLUDE_DIRS})
break()
endif()
endforeach()
# ILLIXR
set(ILLIXR_PATH
""
CACHE PATH "Path to ILLIXR headers"
)
# This one is named differently because that's what CTest uses
option(BUILD_TESTING "Enable building of the test suite?" ON)
option(XRT_FEATURE_COLOR_LOG "Enable logging in color on supported platforms" ON)
cmake_dependent_option(XRT_HAVE_PERCETTO "Enable percetto support" ON "PERCETTO_FOUND" OFF)
cmake_dependent_option(XRT_FEATURE_TRACING "Enable debug tracing on supported platforms" OFF "XRT_HAVE_PERCETTO" OFF)
# Check if Steam's root folder exists
if(EXISTS "$ENV{HOME}/.steam/root")
set(XRT_HAVE_STEAM YES)
endif()
cmake_dependent_option(CMAKE_INTERPROCEDURAL_OPTIMIZATION "Enable inter-procedural (link-time) optimization" OFF "HAS_IPO" OFF)
cmake_dependent_option(XRT_HAVE_WAYLAND "Enable Wayland support" ON "WAYLAND_FOUND AND WAYLAND_SCANNER_FOUND AND WAYLAND_PROTOCOLS_FOUND AND LIBDRM_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_WAYLAND_DIRECT "Enable Wayland direct support" ON "XRT_HAVE_WAYLAND AND LIBDRM_FOUND AND WAYLAND_PROTOCOLS_VERSION VERSION_GREATER_EQUAL 1.22" OFF)
cmake_dependent_option(XRT_HAVE_XLIB "Enable xlib support" ON "X11_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_XRANDR "Enable xlib-xrandr support" ON "XRANDR_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_XCB "Enable xcb support" ON "XCB_FOUND" OFF)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(XRT_HAVE_INTERNAL_HID ON)
endif()
cmake_dependent_option(XRT_HAVE_VULKAN "Enable Vulkan Graphics API support (also needed for compositor)" ON "VULKAN_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_OPENGL "Enable OpenGL Graphics API support" ON "OPENGL_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_OPENGLES "Enable OpenGL-ES Graphics API support" ON "OpenGLES_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_EGL "Enable OpenGL on EGL Graphics API support" ON "EGL_FOUND; XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES" OFF)
cmake_dependent_option(XRT_HAVE_DBUS "Enable dbus support (for BLE support)" ON "DBUS_FOUND" OFF)
cmake_dependent_option(XRT_FEATURE_COMPOSITOR_MAIN "Build main compositor host functionality" ON "XRT_HAVE_VULKAN; XRT_HAVE_WAYLAND OR XRT_HAVE_XCB OR ANDROID OR WIN32" OFF)
cmake_dependent_option(XRT_HAVE_LIBBSD "Enable libbsd support" ON "LIBBSD_FOUND" OFF)
cmake_dependent_option(XRT_FEATURE_OPENXR "Build OpenXR runtime target" ON "XRT_FEATURE_COMPOSITOR_MAIN" OFF)
cmake_dependent_option(XRT_FEATURE_SERVICE "Enable separate service module for OpenXR runtime" ON "NOT WIN32 AND XRT_FEATURE_OPENXR" OFF)
cmake_dependent_option(XRT_HAVE_SYSTEMD "Enable systemd support (for socket activation of service)" ON "Systemd_FOUND AND XRT_FEATURE_SERVICE" OFF)
cmake_dependent_option(XRT_INSTALL_SYSTEMD_UNIT_FILES "Install user unit files for systemd socket activation on installation" ON "XRT_HAVE_SYSTEMD" OFF)
cmake_dependent_option(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES "Use an absolute path to monado-system in installed user unit files for systemd socket activation" ON "XRT_INSTALL_SYSTEMD_UNIT_FILES" OFF)
cmake_dependent_option(XRT_FEATURE_STEAMVR_PLUGIN "Build SteamVR plugin" ON "NOT ANDROID" OFF)
# cmake-format: off
option_with_deps(CMAKE_INTERPROCEDURAL_OPTIMIZATION "Enable inter-procedural (link-time) optimization" DEFAULT OFF DEPENDS HAS_IPO)
option(XRT_HAVE_TRACY "Enable Tracy support for tracing, make sure to set XRT_FEATURE_TRACING as well." OFF)
# Graphics deps to use (sorted in each group, groups thematic and ordered to handle internal deps: e.g. EGL and SDL2 need OpenGL/GLES)
option_with_deps(XRT_HAVE_OPENGL "Enable OpenGL Graphics API support" DEPENDS OPENGL_WITHOUT_GLX_FOUND)
option_with_deps(XRT_HAVE_OPENGL_GLX "Enable OpenGL Graphics API support on X11 (GLX)" DEPENDS XRT_HAVE_OPENGL OpenGL_GLX_FOUND)
option_with_deps(XRT_HAVE_OPENGLES "Enable OpenGL-ES Graphics API support" DEPENDS OpenGLES_FOUND)
option_with_deps(XRT_HAVE_EGL "Enable OpenGL(-ES) on EGL Graphics API support" DEPENDS EGL_FOUND "XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES")
option_with_deps(XRT_HAVE_SDL2 "Enable use of SDL2" DEPENDS SDL2_FOUND XRT_HAVE_OPENGL)
option_with_deps(XRT_HAVE_DXGI "Use DXGI APIs for some Windows-specific functionality" DEPENDS DXGI_LIBRARY)
option_with_deps(XRT_HAVE_WIL "Use WIL for Windows-specific functionality" DEPENDS wil_FOUND)
option_with_deps(XRT_HAVE_WINRT "Use WinRT APIs for some Windows-specific functionality" DEPENDS WINDOWSAPP_LIBRARY)
option_with_deps(XRT_HAVE_VULKAN "Enable Vulkan Graphics API support (also needed for compositor)" DEPENDS VULKAN_FOUND)
option_with_deps(XRT_HAVE_D3D11 "Enable Direct3D 11 Graphics API support" DEPENDS D3D11_LIBRARY XRT_HAVE_VULKAN XRT_HAVE_DXGI XRT_HAVE_WIL)
option_with_deps(XRT_HAVE_D3D12 "Enable Direct3D 12 Graphics API support" DEPENDS D3D12_LIBRARY XRT_HAVE_D3D11 XRT_HAVE_VULKAN XRT_HAVE_DXGI XRT_HAVE_WIL)
option_with_deps(XRT_HAVE_WAYLAND "Enable Wayland support" DEPENDS WAYLAND_FOUND WAYLAND_SCANNER_FOUND WAYLAND_PROTOCOLS_FOUND LIBDRM_FOUND)
option_with_deps(XRT_HAVE_WAYLAND_DIRECT "Enable Wayland direct support" DEPENDS XRT_HAVE_WAYLAND LIBDRM_FOUND "WAYLAND_PROTOCOLS_VERSION VERSION_GREATER_EQUAL 1.22")
option_with_deps(XRT_HAVE_XCB "Enable xcb support" DEPENDS XCB_FOUND)
option_with_deps(XRT_HAVE_XLIB "Enable xlib support" DEPENDS X11_FOUND)
option_with_deps(XRT_HAVE_XRANDR "Enable xlib-xrandr support" DEPENDS XRANDR_FOUND)
# System deps to use (sorted)
option_with_deps(XRT_HAVE_OPENCV "Enable OpenCV backend" DEPENDS OpenCV_FOUND)
option_with_deps(XRT_HAVE_DBUS "Enable dbus support (for BLE support)" DEPENDS DBUS_FOUND)
option_with_deps(XRT_HAVE_LIBBSD "Enable libbsd support" DEPENDS LIBBSD_FOUND)
option_with_deps(XRT_HAVE_LIBUDEV "Enable libudev (used for device probing on Linux)" DEPENDS UDEV_FOUND)
option_with_deps(XRT_HAVE_PERCETTO "Enable percetto support" DEPENDS PERCETTO_FOUND)
option_with_deps(XRT_HAVE_SYSTEMD "Enable systemd support" DEPENDS Systemd_FOUND)
# Only use system cJSON if it includes https://github.com/DaveGamble/cJSON/pull/377
option_with_deps(XRT_HAVE_SYSTEM_CJSON "Enable cJSON from system, instead of bundled source" DEPENDS CJSON_FOUND "cJSON_VERSION VERSION_GREATER_EQUAL 1.7.13")
# Hand tracking deps
option_with_deps(XRT_HAVE_ONNXRUNTIME "Enable ONNX runtime support" DEPENDS ONNXRUNTIME_FOUND)
option(XRT_MODULE_IPC "Enable the build of the IPC layer" ON)
option(XRT_MODULE_COMPOSITOR "Enable the compositor at all" ON)
option_with_deps(XRT_MODULE_COMPOSITOR_MAIN "Build main compositor host functionality" DEPENDS
XRT_MODULE_COMPOSITOR
XRT_HAVE_VULKAN
"XRT_HAVE_WAYLAND OR XRT_HAVE_XCB OR ANDROID OR WIN32"
)
option_with_deps(XRT_MODULE_COMPOSITOR_NULL "Build testing null compositor" DEPENDS XRT_MODULE_COMPOSITOR XRT_HAVE_VULKAN)
option_with_deps(XRT_MODULE_MERCURY_HANDTRACKING "Enable Mercury hand tracking" DEPENDS XRT_HAVE_OPENCV XRT_HAVE_ONNXRUNTIME)
option(XRT_MODULE_MONADO_CLI "Build monado-cli" ON)
option_with_deps(XRT_MODULE_MONADO_GUI "Build monado-gui" DEPENDS XRT_HAVE_SDL2)
option(XRT_MODULE_AUX_VIVE "Build aux_vive" ON)
# Feature configuration (sorted)
option_with_deps(XRT_FEATURE_COLOR_LOG "Enable logging in color on supported platforms" DEPENDS XRT_HAVE_LINUX)
option_with_deps(XRT_FEATURE_OPENXR "Build OpenXR runtime target" DEPENDS "XRT_MODULE_COMPOSITOR_MAIN OR XRT_MODULE_COMPOSITOR_NULL")
set(XRT_FEATURE_OPENXR_DEBUG_UTILS OFF) # Has never been enabled
option_with_deps(XRT_FEATURE_RENDERDOC "Enable RenderDoc API" DEPENDS "RT_LIBRARY OR WIN32 OR ANDROID")
option_with_deps(XRT_FEATURE_SERVICE "Enable separate service module for OpenXR runtime" DEPENDS XRT_MODULE_IPC XRT_FEATURE_OPENXR)
option_with_deps(XRT_FEATURE_SERVICE_SYSTEMD "Enable systemd socket activation of the service" DEPENDS XRT_HAVE_SYSTEMD XRT_FEATURE_SERVICE)
option_with_deps(XRT_FEATURE_SLAM "Enable SLAM tracking support" DEPENDS XRT_HAVE_OPENCV XRT_HAVE_LINUX)
option(XRT_FEATURE_SSE2 "Build using SSE2 instructions, if building for 32-bit x86" ON)
option_with_deps(XRT_FEATURE_STEAMVR_PLUGIN "Build SteamVR plugin" DEPENDS "NOT ANDROID")
option_with_deps(XRT_FEATURE_TRACING "Enable debug tracing on supported platforms" DEFAULT OFF DEPENDS "XRT_HAVE_PERCETTO OR XRT_HAVE_TRACY")
option_with_deps(XRT_FEATURE_WINDOW_PEEK "Enable a window that displays the content of the HMD on screen" DEPENDS XRT_HAVE_SDL2)
option_with_deps(XRT_FEATURE_DEBUG_GUI "Enable debug window to be used" DEPENDS XRT_HAVE_SDL2)
if (XRT_FEATURE_SERVICE)
# Disable the client debug gui by default for out-of-proc -
# too many clients have problems with depending on SDL/GStreamer/etc and we rarely use it in this configuration
option_with_deps(XRT_FEATURE_CLIENT_DEBUG_GUI "Allow clients to have their own instances of the debug gui" DEFAULT OFF DEPENDS XRT_FEATURE_DEBUG_GUI)
else()
# Enable the client debug gui by default for in-proc -
# In in-proc, the client debug gui is the same as the server debug gui, and we use it a lot in this configuration
option_with_deps(XRT_FEATURE_CLIENT_DEBUG_GUI "Allow clients to have their own instances of the debug gui" DEFAULT ON DEPENDS XRT_FEATURE_DEBUG_GUI)
endif()
# systemd detailed config
option_with_deps(XRT_INSTALL_SYSTEMD_UNIT_FILES "Install user unit files for systemd socket activation on installation" DEPENDS XRT_HAVE_SYSTEMD)
option_with_deps(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES "Use an absolute path to monado-system in installed user unit files for systemd socket activation" DEPENDS XRT_HAVE_SYSTEMD)
# Driver deps to use (sorted, though there are some internal dependencies)
option_with_deps(XRT_HAVE_BLUETOOTH "Enable Bluetooth (legacy, non-ble)" DEPENDS BLUETOOTH_FOUND)
option_with_deps(XRT_HAVE_GST "Enable gstreamer" DEPENDS GST_FOUND)
option_with_deps(XRT_HAVE_HIDAPI "Enable libhidapi (used for PSVR)" DEPENDS HIDAPI_FOUND)
option_with_deps(XRT_HAVE_JPEG "Enable jpeg code (used for some video drivers)" DEPENDS JPEG_FOUND)
option_with_deps(XRT_HAVE_LIBUSB "Enable libusb (used for most drivers)" DEPENDS LIBUSB1_FOUND)
option_with_deps(XRT_HAVE_LIBUVC "Enable libuvc video driver" DEPENDS LIBUVC_FOUND XRT_HAVE_LIBUSB)
option_with_deps(XRT_HAVE_REALSENSE "Enable RealSense support" DEPENDS realsense2_FOUND)
option_with_deps(XRT_HAVE_OPENVR "Enable OpenVR support" DEPENDS OPENVR_FOUND)
# Drivers to build (sorted)
option_with_deps(XRT_BUILD_DRIVER_ANDROID "Enable Android sensors driver" DEPENDS ANDROID)
option_with_deps(XRT_BUILD_DRIVER_ARDUINO "Enable Arduino input device with BLE" DEPENDS XRT_HAVE_DBUS)
option_with_deps(XRT_BUILD_DRIVER_DAYDREAM "Enable the Google Daydream View controller driver (BLE)" DEPENDS XRT_HAVE_DBUS)
option_with_deps(XRT_BUILD_DRIVER_DEPTHAI "DepthAI" DEPENDS depthai_FOUND)
option_with_deps(XRT_BUILD_DRIVER_EUROC "Enable EuRoC dataset driver for SLAM evaluation" DEPENDS XRT_HAVE_OPENCV "NOT MSVC")
option_with_deps(XRT_BUILD_DRIVER_HANDTRACKING "Enable Camera Hand Tracking driver" DEPENDS XRT_MODULE_MERCURY_HANDTRACKING)
option_with_deps(XRT_BUILD_DRIVER_TWRAP "Enable Tracking Wrapper drivers" ON) # only depends on imu
option_with_deps(XRT_BUILD_DRIVER_HDK "Enable HDK driver" DEPENDS XRT_HAVE_INTERNAL_HID)
option_with_deps(XRT_BUILD_DRIVER_HYDRA "Enable Hydra driver" DEPENDS XRT_HAVE_INTERNAL_HID)
option_with_deps(XRT_BUILD_DRIVER_ILLIXR "Enable ILLIXR driver" DEPENDS ILLIXR_PATH)
option(XRT_BUILD_DRIVER_NS "Enable North Star driver" ON)
option_with_deps(XRT_BUILD_DRIVER_OHMD "Enable OpenHMD driver" DEPENDS OPENHMD_FOUND)
option_with_deps(XRT_BUILD_DRIVER_OPENGLOVES "Enable OpenGloves driver" DEPENDS XRT_HAVE_LIBUDEV XRT_HAVE_BLUETOOTH)
option_with_deps(XRT_BUILD_DRIVER_PSMV "Enable Playstation Move driver" DEPENDS XRT_HAVE_INTERNAL_HID "NOT MSVC")
option_with_deps(XRT_BUILD_DRIVER_PSSENSE "Enable PlayStation Sense driver" DEPENDS XRT_HAVE_INTERNAL_HID)
option_with_deps(XRT_BUILD_DRIVER_PSVR "Enable PSVR HMD driver" DEPENDS XRT_HAVE_HIDAPI)
option_with_deps(XRT_BUILD_DRIVER_QWERTY "Enable Qwerty driver" DEPENDS XRT_HAVE_SDL2)
option_with_deps(XRT_BUILD_DRIVER_REALSENSE "Enable RealSense device driver" DEPENDS XRT_HAVE_REALSENSE)
option_with_deps(XRT_BUILD_DRIVER_REMOTE "Enable remote debugging driver" DEPENDS "XRT_HAVE_LINUX OR ANDROID OR WIN32")
option_with_deps(XRT_BUILD_DRIVER_RIFT_S "Enable Oculus Rift S device driver" DEPENDS XRT_HAVE_HIDAPI XRT_HAVE_V4L2)
option_with_deps(XRT_BUILD_DRIVER_ROKID "Enable Rokid driver" DEPENDS "XRT_HAVE_LIBUSB")
option_with_deps(XRT_BUILD_DRIVER_STEAMVR_LIGHTHOUSE "Enable SteamVR Lighthouse driver" DEPENDS XRT_HAVE_LINUX XRT_HAVE_STEAM XRT_MODULE_AUX_VIVE)
option_with_deps(XRT_BUILD_DRIVER_SURVIVE "Enable libsurvive driver" DEPENDS SURVIVE_FOUND XRT_MODULE_AUX_VIVE)
option_with_deps(XRT_BUILD_DRIVER_ULV2 "Enable Ultraleap v2 driver" DEPENDS LeapV2_FOUND)
option_with_deps(XRT_BUILD_DRIVER_ULV5 "Enable Ultraleap v5 driver" DEPENDS LeapSDK_FOUND)
option_with_deps(XRT_BUILD_DRIVER_VF "Build video frame driver (for video file support, uses gstreamer)" DEPENDS XRT_HAVE_GST)
option_with_deps(XRT_BUILD_DRIVER_VIVE "Enable driver for HTC Vive, Vive Pro, Valve Index, and their controllers" DEPENDS ZLIB_FOUND XRT_HAVE_LINUX XRT_MODULE_AUX_VIVE)
option_with_deps(XRT_BUILD_DRIVER_WMR "Enable Windows Mixed Reality driver" DEPENDS "NOT WIN32")
option_with_deps(XRT_BUILD_DRIVER_XREAL_AIR "Enable Xreal Air HMD driver" DEPENDS XRT_HAVE_HIDAPI)
option_with_deps(XRT_BUILD_DRIVER_SIMULAVR "Enable simula driver" DEPENDS XRT_HAVE_REALSENSE)
option(XRT_BUILD_DRIVER_SIMULATED "Enable simulated driver" ON)
option(XRT_BUILD_SAMPLES "Enable compiling sample code implementations that will not be linked into any final targets" ON)
set(XRT_IPC_MSG_SOCK_FILENAME monado_comp_ipc CACHE STRING "Service socket filename")
set(XRT_IPC_SERVICE_PID_FILENAME monado.pid CACHE STRING "Service pidfile filename")
set(XRT_OXR_RUNTIME_SUFFIX monado CACHE STRING "OpenXR client library suffix")
# cmake-format: on
# Most users won't touch these.
mark_as_advanced(XRT_MODULE_COMPOSITOR_MAIN XRT_MODULE_COMPOSITOR_NULL XRT_FEATURE_OPENXR)
# Misc extension support.
if(NOT DEFINED XRT_FEATURE_OPENXR_DISPLAY_REFRESH_RATE)
set(XRT_FEATURE_OPENXR_DISPLAY_REFRESH_RATE ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_FORCE_FEEDBACK_CURL)
set(XRT_FEATURE_OPENXR_FORCE_FEEDBACK_CURL ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_HEADLESS)
set(XRT_FEATURE_OPENXR_HEADLESS ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_OVERLAY)
set(XRT_FEATURE_OPENXR_OVERLAY ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_VISIBILITY_MASK)
set(XRT_FEATURE_OPENXR_VISIBILITY_MASK ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_PERFORMANCE_SETTINGS)
set(XRT_FEATURE_OPENXR_PERFORMANCE_SETTINGS OFF)
endif()
option(
XRT_FEATURE_OPENXR_VULKAN_SWAPCHAIN_FORMAT_LIST
"Enable support for the XR_KHR_vulkan_swapchain_format_list extension" ON
)
if(NOT DEFINED XRT_FEATURE_OPENXR_FACIAL_TRACKING_HTC)
set(XRT_FEATURE_OPENXR_FACIAL_TRACKING_HTC OFF)
endif()
# Interaction extension support.
if(NOT DEFINED XRT_FEATURE_OPENXR_INTERACTION_EXT_EYE_GAZE)
set(XRT_FEATURE_OPENXR_INTERACTION_EXT_EYE_GAZE ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_INTERACTION_EXT_HAND)
set(XRT_FEATURE_OPENXR_INTERACTION_EXT_HAND ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_INTERACTION_EXT_PALM_POSE)
set(XRT_FEATURE_OPENXR_INTERACTION_EXT_PALM_POSE OFF)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_INTERACTION_ML2)
set(XRT_FEATURE_OPENXR_INTERACTION_ML2 ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_INTERACTION_MNDX)
set(XRT_FEATURE_OPENXR_INTERACTION_MNDX ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_INTERACTION_MSFT_HAND)
set(XRT_FEATURE_OPENXR_INTERACTION_MSFT_HAND OFF)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_INTERACTION_OPPO)
set(XRT_FEATURE_OPENXR_INTERACTION_OPPO ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_INTERACTION_WINMR)
set(XRT_FEATURE_OPENXR_INTERACTION_WINMR ON)
endif()
# Defaults for OpenXR layer support
if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_DEPTH)
set(XRT_FEATURE_OPENXR_LAYER_DEPTH ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_COLOR_SCALE_BIAS)
set(XRT_FEATURE_OPENXR_LAYER_COLOR_SCALE_BIAS OFF)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_CUBE)
set(XRT_FEATURE_OPENXR_LAYER_CUBE OFF)
endif()
@ -187,89 +411,71 @@ if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_EQUIRECT2)
set(XRT_FEATURE_OPENXR_LAYER_EQUIRECT2 ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_EQUIRECT1)
set(XRT_FEATURE_OPENXR_LAYER_EQUIRECT1 ON)
set(XRT_FEATURE_OPENXR_LAYER_EQUIRECT1 OFF)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_FB_ALPHA_BLEND)
set(XRT_FEATURE_OPENXR_LAYER_FB_ALPHA_BLEND OFF)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_FB_IMAGE_LAYOUT)
set(XRT_FEATURE_OPENXR_LAYER_FB_IMAGE_LAYOUT ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_FB_SETTINGS)
set(XRT_FEATURE_OPENXR_LAYER_FB_SETTINGS OFF)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_FB_DEPTH_TEST)
set(XRT_FEATURE_OPENXR_LAYER_FB_DEPTH_TEST OFF)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_PASSTHROUGH)
set(XRT_FEATURE_OPENXR_LAYER_PASSTHROUGH OFF)
endif()
# Most users won't touch these.
mark_as_advanced(XRT_FEATURE_COMPOSITOR_MAIN XRT_FEATURE_OPENXR)
# ILLIXR
set(ILLIXR_PATH "" CACHE PATH "Path to ILLIXR headers")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(XRT_HAVE_LIBUDEV ON)
set(XRT_HAVE_INTERNAL_HID ON)
else()
cmake_dependent_option(XRT_HAVE_LIBUDEV "Enable libudev (used for device probing on Linux)" ON "UDEV_FOUND" OFF)
# Defaults for OpenXR spaces
if(NOT DEFINED XRT_FEATURE_OPENXR_SPACE_LOCAL_FLOOR)
set(XRT_FEATURE_OPENXR_SPACE_LOCAL_FLOOR ON)
endif()
if(NOT DEFINED XRT_FEATURE_OPENXR_SPACE_UNBOUNDED)
set(XRT_FEATURE_OPENXR_SPACE_UNBOUNDED ON)
endif()
cmake_dependent_option(XRT_HAVE_LIBUSB "Enable libusb (used for most drivers)" ON "LIBUSB1_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_JPEG "Enable jpeg code (used for some video drivers)" ON "JPEG_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_OPENCV "Enable OpenCV backend" ON "OpenCV_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_LIBUVC "Enable libuvc video driver" ON "LIBUVC_FOUND AND XRT_HAVE_LIBUSB" OFF)
cmake_dependent_option(XRT_HAVE_FFMPEG "Enable ffmpeg testing video driver" ON "FFMPEG_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_SDL2 "Enable use of SDL2" ON "SDL2_FOUND AND XRT_HAVE_OPENGL" OFF)
cmake_dependent_option(XRT_HAVE_SYSTEM_CJSON "Enable cJSON from system, instead of bundled source" ON "CJSON_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_GST "Enable gstreamer" ON "GST_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_ONNXRUNTIME "Enable ONNX runtime support" ON "ONNXRUNTIME_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_KIMERA_SLAM "Enable Kimera support" ON "kimera_vio_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_SLAM "Enable SLAM tracking support" ON "SLAM;XRT_HAVE_OPENCV" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_PSVR "Enable PSVR HMD driver" ON "HIDAPI_FOUND" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_RS "Enable RealSense device driver" ON "realsense2_FOUND" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_VIVE "Enable driver for HTC Vive, Vive Pro, Valve Index, and their controllers" ON "ZLIB_FOUND AND XRT_HAVE_LINUX" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_OHMD "Enable OpenHMD driver" ON "OPENHMD_FOUND" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_HANDTRACKING "Enable Camera Hand Tracking driver" ON "XRT_HAVE_ONNXRUNTIME AND XRT_HAVE_OPENCV AND XRT_HAVE_V4L2" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_DAYDREAM "Enable the Google Daydream View controller driver (BLE, via D-Bus)" ON "XRT_HAVE_DBUS" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_ARDUINO "Enable Arduino input device with BLE via via D-Bus" ON "XRT_HAVE_DBUS" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_ILLIXR "Enable ILLIXR driver" ON "ILLIXR_PATH" OFF)
option(XRT_BUILD_DRIVER_DUMMY "Enable dummy driver" ON)
cmake_dependent_option(XRT_BUILD_DRIVER_ULV2 "Enable Ultraleap v2 driver" ON "LeapV2_FOUND" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_REMOTE "Enable remote debugging driver" ON "XRT_HAVE_LINUX OR ANDROID" OFF)
option(XRT_BUILD_DRIVER_WMR "Enable Windows Mixed Reality driver" ON)
# These all use the Monado internal hid wrapper.
cmake_dependent_option(XRT_BUILD_DRIVER_HDK "Enable HDK driver" ON "XRT_HAVE_INTERNAL_HID" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_PSMV "Enable Playstation Move driver" ON "XRT_HAVE_INTERNAL_HID" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_HYDRA "Enable Hydra driver" ON "XRT_HAVE_INTERNAL_HID" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_NS "Enable North Star driver" ON "XRT_HAVE_INTERNAL_HID" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_VF "Build video frame driver (for video file support, uses gstreamer)" ON "XRT_HAVE_GST" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_DEPTHAI "DepthAI" ON "depthai_FOUND" OFF)
# This one defaults to off, even if we find the deps.
cmake_dependent_option(XRT_BUILD_DRIVER_SURVIVE "Enable libsurvive driver" ON "SURVIVE_FOUND" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_ANDROID "Enable Android sensors driver" ON "ANDROID" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_QWERTY "Enable Qwerty driver" ON "XRT_HAVE_SDL2" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_EUROC "Enable EuRoC dataset driver for SLAM evaluation" ON "XRT_HAVE_OPENCV" OFF)
# You can set this from a superproject to add a driver
# All drivers must be listed in here to be included in the generated header!
list(APPEND AVAILABLE_DRIVERS
list(
APPEND
AVAILABLE_DRIVERS
"ANDROID"
"ARDUINO"
"DAYDREAM"
"DUMMY"
"SIMULATED"
"HANDTRACKING"
"HDK"
"HYDRA"
"ILLIXR"
"NS"
"OHMD"
"OPENGLOVES"
"PSMV"
"PSSENSE"
"PSVR"
"RS"
"REALSENSE"
"REMOTE"
"RIFT_S"
"ROKID"
"SURVIVE"
"V4L2"
"ULV2"
"ULV5"
"VF"
"DEPTHAI"
"VIVE"
"QWERTY"
"WMR"
"EUROC"
"SIMULAVR"
"TWRAP"
"XREAL_AIR"
"STEAMVR_LIGHTHOUSE"
)
# Package name needs to be known by the native code itself.
# Can be overridden from outside/command line
if(ANDROID AND NOT XRT_ANDROID_PACKAGE)
@ -284,6 +490,10 @@ endif()
# Flags
###
if(XRT_HAVE_TRACY AND XRT_HAVE_PERCETTO)
message(FATAL_ERROR "Max one tracing backend, XRT_HAVE_TRACY and XRT_HAVE_PERCETTO enabled")
endif()
if(XRT_HAVE_XLIB AND NOT XRT_HAVE_XRANDR)
message(WARNING "XRT_HAVE_XLIB requires XRT_HAVE_XRANDR but XRT_HAVE_XRANDR is disabled")
endif()
@ -293,12 +503,10 @@ if(XRT_HAVE_OPENGLES AND NOT XRT_HAVE_EGL)
endif()
if(XRT_HAVE_SDL2)
if(NOT DEFINED SDL2_LIBRARIES)
if(TARGET SDL2::SDL2-static)
set(SDL2_LIBRARIES SDL2::SDL2-static)
elseif(TARGET SDL2::SDL2)
set(SDL2_LIBRARIES SDL2::SDL2)
endif()
if(NOT TARGET SDL2::SDL2 AND DEFINED SDL2_LIBRARIES)
add_library(SDL2::SDL2 INTERFACE IMPORTED)
target_include_directories(SDL2::SDL2 SYSTEM INTERFACE "${SDL2_INCLUDE_DIRS}")
target_link_libraries(SDL2::SDL2 INTERFACE "${SDL2_LIBRARIES}")
endif()
endif()
@ -306,7 +514,10 @@ endif()
if(XRT_HAVE_XCB)
set(VK_USE_PLATFORM_XCB_KHR TRUE)
endif()
if(XRT_HAVE_XCB AND XRT_HAVE_XLIB AND XRT_HAVE_XRANDR)
if(XRT_HAVE_XCB
AND XRT_HAVE_XLIB
AND XRT_HAVE_XRANDR
)
set(VK_USE_PLATFORM_XLIB_XRANDR_EXT TRUE)
endif()
if(XRT_HAVE_WAYLAND)
@ -318,19 +529,11 @@ endif()
if(WIN32)
set(VK_USE_PLATFORM_WIN32_KHR TRUE)
endif()
if (XRT_HAVE_VULKAN AND NOT ANDROID)
if(XRT_HAVE_VULKAN AND NOT ANDROID)
set(VK_USE_PLATFORM_DISPLAY_KHR TRUE)
endif()
if(NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Werror=incompatible-pointer-types")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
endif()
include(CompilerFlags.cmake)
# Default to PIC code
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@ -341,18 +544,21 @@ if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
endif()
# Make sure we have pretty colours
option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE)
option(DISABLE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF)
if ("${FORCE_COLORED_OUTPUT}")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options (-fdiagnostics-color=always)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options (-fcolor-diagnostics)
endif ()
endif ()
if(NOT DISABLE_COLORED_OUTPUT)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-fdiagnostics-color=always)
elseif(
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL
"AppleClang"
)
add_compile_options(-fcolor-diagnostics)
endif()
endif()
###
# Decend into madness.
# Descend into the source
###
add_subdirectory(src)
@ -363,70 +569,149 @@ if(BUILD_TESTING)
add_subdirectory(tests)
endif()
###
# Keep these lists sorted
###
# cmake-format: off
message(STATUS "#####----- Config -----#####")
message(STATUS "# GIT_DESC: ${GIT_DESC}")
message(STATUS "#")
message(STATUS "# BLUETOOTH: ${XRT_HAVE_BLUETOOTH}")
message(STATUS "# D3D11: ${XRT_HAVE_D3D11}")
message(STATUS "# D3D12: ${XRT_HAVE_D3D12}")
message(STATUS "# DBUS: ${XRT_HAVE_DBUS}")
message(STATUS "# EGL: ${XRT_HAVE_EGL}")
message(STATUS "# GST (GStreamer): ${XRT_HAVE_GST}")
message(STATUS "# WAYLAND: ${XRT_HAVE_WAYLAND}")
message(STATUS "# WAYLAND_DIRECT: ${XRT_HAVE_WAYLAND_DIRECT}")
message(STATUS "# XLIB: ${XRT_HAVE_XLIB}")
message(STATUS "# XRANDR: ${XRT_HAVE_XRANDR}")
message(STATUS "# XCB: ${XRT_HAVE_XCB}")
message(STATUS "# VULKAN: ${XRT_HAVE_VULKAN}")
message(STATUS "# HIDAPI: ${XRT_HAVE_HIDAPI}")
message(STATUS "# JPEG: ${XRT_HAVE_JPEG}")
message(STATUS "# LIBBSD: ${XRT_HAVE_LIBBSD}")
message(STATUS "# LIBUSB: ${XRT_HAVE_LIBUSB}")
message(STATUS "# LIBUVC: ${XRT_HAVE_LIBUVC}")
message(STATUS "# ONNXRUNTIME: ${XRT_HAVE_ONNXRUNTIME}")
message(STATUS "# OPENCV: ${XRT_HAVE_OPENCV}")
message(STATUS "# OPENGL: ${XRT_HAVE_OPENGL}")
message(STATUS "# OPENGLES: ${XRT_HAVE_OPENGLES}")
message(STATUS "# EGL: ${XRT_HAVE_EGL}")
message(STATUS "# DBUS: ${XRT_HAVE_DBUS}")
message(STATUS "# LIBBSD: ${XRT_HAVE_LIBBSD}")
message(STATUS "# SYSTEMD: ${XRT_HAVE_SYSTEMD}")
message(STATUS "# LIBUSB: ${XRT_HAVE_LIBUSB}")
message(STATUS "# JPEG: ${XRT_HAVE_JPEG}")
message(STATUS "# OPENCV: ${XRT_HAVE_OPENCV}")
message(STATUS "# LIBUVC: ${XRT_HAVE_LIBUVC}")
message(STATUS "# FFMPEG: ${XRT_HAVE_FFMPEG}")
message(STATUS "# SDL2: ${XRT_HAVE_SDL2}")
message(STATUS "# OPENGL_GLX: ${XRT_HAVE_OPENGL_GLX}")
message(STATUS "# PERCETTO: ${XRT_HAVE_PERCETTO}")
message(STATUS "# ONNXRUNTIME: ${XRT_HAVE_ONNXRUNTIME}")
message(STATUS "# REALSENSE: ${XRT_HAVE_REALSENSE}")
message(STATUS "# OPENVR: ${XRT_HAVE_OPENVR}")
message(STATUS "# SDL2: ${XRT_HAVE_SDL2}")
message(STATUS "# SYSTEM_CJSON: ${XRT_HAVE_SYSTEM_CJSON}")
message(STATUS "# KIMERA: ${XRT_HAVE_KIMERA_SLAM}")
message(STATUS "# SLAM: ${XRT_HAVE_SLAM}")
message(STATUS "# SYSTEMD: ${XRT_HAVE_SYSTEMD}")
message(STATUS "# TRACY: ${XRT_HAVE_TRACY}")
message(STATUS "# VULKAN: ${XRT_HAVE_VULKAN}")
message(STATUS "# WAYLAND: ${XRT_HAVE_WAYLAND}")
message(STATUS "# WAYLAND_DIRECT: ${XRT_HAVE_WAYLAND_DIRECT}")
message(STATUS "# XCB: ${XRT_HAVE_XCB}")
message(STATUS "# XLIB: ${XRT_HAVE_XLIB}")
message(STATUS "# XRANDR: ${XRT_HAVE_XRANDR}")
message(STATUS "#")
message(STATUS "# FEATURE_COMPOSITOR_MAIN: ${XRT_FEATURE_COMPOSITOR_MAIN}")
message(STATUS "# FEATURE_SERVICE: ${XRT_FEATURE_SERVICE}")
message(STATUS "# FEATURE_OPENXR: ${XRT_FEATURE_OPENXR}")
message(STATUS "# FEATURE_OPENXR_LAYER_DEPTH: ${XRT_FEATURE_OPENXR_LAYER_DEPTH}")
message(STATUS "# FEATURE_OPENXR_LAYER_CUBE: ${XRT_FEATURE_OPENXR_LAYER_CUBE}")
message(STATUS "# FEATURE_OPENXR_LAYER_CYLINDER: ${XRT_FEATURE_OPENXR_LAYER_CYLINDER}")
message(STATUS "# FEATURE_OPENXR_LAYER_EQUIRECT2: ${XRT_FEATURE_OPENXR_LAYER_EQUIRECT2}")
message(STATUS "# FEATURE_OPENXR_LAYER_EQUIRECT1: ${XRT_FEATURE_OPENXR_LAYER_EQUIRECT1}")
message(STATUS "# FEATURE_STEAMVR_PLUGIN: ${XRT_FEATURE_STEAMVR_PLUGIN}")
message(STATUS "# FEATURE_COLOR_LOG: ${XRT_FEATURE_COLOR_LOG}")
message(STATUS "# FEATURE_TRACING: ${XRT_FEATURE_TRACING}")
message(STATUS "# MODULE_AUX_VIVE: ${XRT_MODULE_AUX_VIVE}")
message(STATUS "# MODULE_COMPOSITOR: ${XRT_MODULE_COMPOSITOR}")
message(STATUS "# MODULE_COMPOSITOR_MAIN: ${XRT_MODULE_COMPOSITOR_MAIN}")
message(STATUS "# MODULE_COMPOSITOR_NULL: ${XRT_MODULE_COMPOSITOR_NULL}")
message(STATUS "# MODULE_MERCURY_HANDTRACKING: ${XRT_MODULE_MERCURY_HANDTRACKING}")
message(STATUS "# MODULE_IPC: ${XRT_MODULE_IPC}")
message(STATUS "# MODULE_MONADO_GUI: ${XRT_MODULE_MONADO_GUI}")
message(STATUS "# MODULE_MONADO_CLI: ${XRT_MODULE_MONADO_CLI}")
message(STATUS "#")
message(STATUS "# DRIVER_ANDROID: ${XRT_BUILD_DRIVER_ANDROID}")
message(STATUS "# DRIVER_ARDUINO: ${XRT_BUILD_DRIVER_ARDUINO}")
message(STATUS "# DRIVER_DAYDREAM: ${XRT_BUILD_DRIVER_DAYDREAM}")
message(STATUS "# DRIVER_DUMMY: ${XRT_BUILD_DRIVER_DUMMY}")
message(STATUS "# DRIVER_HANDTRACKING: ${XRT_BUILD_DRIVER_HANDTRACKING}")
message(STATUS "# DRIVER_HDK: ${XRT_BUILD_DRIVER_HDK}")
message(STATUS "# DRIVER_HYDRA: ${XRT_BUILD_DRIVER_HYDRA}")
message(STATUS "# DRIVER_ILLIXR: ${XRT_BUILD_DRIVER_ILLIXR}")
message(STATUS "# DRIVER_NS: ${XRT_BUILD_DRIVER_NS}")
message(STATUS "# DRIVER_ULV2: ${XRT_BUILD_DRIVER_ULV2}")
message(STATUS "# DRIVER_OHMD: ${XRT_BUILD_DRIVER_OHMD}")
message(STATUS "# DRIVER_PSMV: ${XRT_BUILD_DRIVER_PSMV}")
message(STATUS "# DRIVER_PSVR: ${XRT_BUILD_DRIVER_PSVR}")
message(STATUS "# DRIVER_RS: ${XRT_BUILD_DRIVER_RS}")
message(STATUS "# DRIVER_REMOTE: ${XRT_BUILD_DRIVER_REMOTE}")
message(STATUS "# DRIVER_SURVIVE: ${XRT_BUILD_DRIVER_SURVIVE}")
message(STATUS "# DRIVER_VF: ${XRT_BUILD_DRIVER_VF}")
message(STATUS "# DRIVER_DEPTHAI: ${XRT_BUILD_DRIVER_DEPTHAI}")
message(STATUS "# DRIVER_VIVE: ${XRT_BUILD_DRIVER_VIVE}")
message(STATUS "# DRIVER_QWERTY: ${XRT_BUILD_DRIVER_QWERTY}")
message(STATUS "# DRIVER_WMR: ${XRT_BUILD_DRIVER_WMR}")
message(STATUS "# DRIVER_EUROC: ${XRT_BUILD_DRIVER_EUROC}")
message(STATUS "# FEATURE_CLIENT_DEBUG_GUI: ${XRT_FEATURE_CLIENT_DEBUG_GUI}")
message(STATUS "# FEATURE_COLOR_LOG: ${XRT_FEATURE_COLOR_LOG}")
message(STATUS "# FEATURE_DEBUG_GUI: ${XRT_FEATURE_DEBUG_GUI}")
message(STATUS "# FEATURE_OPENXR: ${XRT_FEATURE_OPENXR}")
message(STATUS "# FEATURE_OPENXR_DEBUG_UTILS: ${XRT_FEATURE_OPENXR_DEBUG_UTILS}")
message(STATUS "# FEATURE_OPENXR_DISPLAY_REFRESH_RATE: ${XRT_FEATURE_OPENXR_DISPLAY_REFRESH_RATE}")
message(STATUS "# FEATURE_OPENXR_FACIAL_TRACKING_HTC: ${XRT_FEATURE_OPENXR_FACIAL_TRACKING_HTC}")
message(STATUS "# FEATURE_OPENXR_FORCE_FEEDBACK_CURL: ${XRT_FEATURE_OPENXR_FORCE_FEEDBACK_CURL}")
message(STATUS "# FEATURE_OPENXR_HEADLESS: ${XRT_FEATURE_OPENXR_HEADLESS}")
message(STATUS "# FEATURE_OPENXR_INTERACTION_EXT_EYE_GAZE: ${XRT_FEATURE_OPENXR_INTERACTION_EXT_EYE_GAZE}")
message(STATUS "# FEATURE_OPENXR_INTERACTION_EXT_HAND: ${XRT_FEATURE_OPENXR_INTERACTION_EXT_HAND}")
message(STATUS "# FEATURE_OPENXR_INTERACTION_EXT_PALM_POSE: ${XRT_FEATURE_OPENXR_INTERACTION_EXT_PALM_POSE}")
message(STATUS "# FEATURE_OPENXR_INTERACTION_ML2: ${XRT_FEATURE_OPENXR_INTERACTION_ML2}")
message(STATUS "# FEATURE_OPENXR_INTERACTION_MNDX: ${XRT_FEATURE_OPENXR_INTERACTION_MNDX}")
message(STATUS "# FEATURE_OPENXR_INTERACTION_MSFT_HAND: ${XRT_FEATURE_OPENXR_INTERACTION_MSFT_HAND}")
message(STATUS "# FEATURE_OPENXR_INTERACTION_OPPO: ${XRT_FEATURE_OPENXR_INTERACTION_OPPO}")
message(STATUS "# FEATURE_OPENXR_INTERACTION_WINMR: ${XRT_FEATURE_OPENXR_INTERACTION_WINMR}")
message(STATUS "# FEATURE_OPENXR_LAYER_COLOR_SCALE_BIAS: ${XRT_FEATURE_OPENXR_LAYER_COLOR_SCALE_BIAS}")
message(STATUS "# FEATURE_OPENXR_LAYER_CUBE: ${XRT_FEATURE_OPENXR_LAYER_CUBE}")
message(STATUS "# FEATURE_OPENXR_LAYER_CYLINDER: ${XRT_FEATURE_OPENXR_LAYER_CYLINDER}")
message(STATUS "# FEATURE_OPENXR_LAYER_DEPTH: ${XRT_FEATURE_OPENXR_LAYER_DEPTH}")
message(STATUS "# FEATURE_OPENXR_LAYER_EQUIRECT1: ${XRT_FEATURE_OPENXR_LAYER_EQUIRECT1}")
message(STATUS "# FEATURE_OPENXR_LAYER_EQUIRECT2: ${XRT_FEATURE_OPENXR_LAYER_EQUIRECT2}")
message(STATUS "# FEATURE_OPENXR_LAYER_FB_ALPHA_BLEND: ${XRT_FEATURE_OPENXR_LAYER_FB_ALPHA_BLEND}")
message(STATUS "# FEATURE_OPENXR_LAYER_PASSTHROUGH: ${XRT_FEATURE_OPENXR_LAYER_PASSTHROUGH}")
message(STATUS "# FEATURE_OPENXR_LAYER_FB_IMAGE_LAYOUT ${XRT_FEATURE_OPENXR_LAYER_FB_IMAGE_LAYOUT}")
message(STATUS "# FEATURE_OPENXR_LAYER_FB_SETTINGS: ${XRT_FEATURE_OPENXR_LAYER_FB_SETTINGS}")
message(STATUS "# FEATURE_OPENXR_LAYER_FB_DEPTH_TEST: ${XRT_FEATURE_OPENXR_LAYER_FB_DEPTH_TEST}")
message(STATUS "# FEATURE_OPENXR_OVERLAY: ${XRT_FEATURE_OPENXR_OVERLAY}")
message(STATUS "# FEATURE_OPENXR_PERFORMANCE_SETTINGS: ${XRT_FEATURE_OPENXR_PERFORMANCE_SETTINGS}")
message(STATUS "# FEATURE_OPENXR_SPACE_LOCAL_FLOOR: ${XRT_FEATURE_OPENXR_SPACE_LOCAL_FLOOR}")
message(STATUS "# FEATURE_OPENXR_SPACE_UNBOUNDED: ${XRT_FEATURE_OPENXR_SPACE_UNBOUNDED}")
message(STATUS "# FEATURE_OPENXR_VISIBILITY_MASK ${XRT_FEATURE_OPENXR_VISIBILITY_MASK}")
message(STATUS "# FEATURE_OPENXR_VULKAN_SWAPCHAIN_FORMAT_LIST ${XRT_FEATURE_OPENXR_VULKAN_SWAPCHAIN_FORMAT_LIST}")
message(STATUS "# FEATURE_RENDERDOC: ${XRT_FEATURE_RENDERDOC}")
message(STATUS "# FEATURE_SERVICE: ${XRT_FEATURE_SERVICE}")
message(STATUS "# FEATURE_SERVICE_SYSTEMD: ${XRT_FEATURE_SERVICE_SYSTEMD}")
message(STATUS "# FEATURE_SLAM: ${XRT_FEATURE_SLAM}")
message(STATUS "# FEATURE_SSE2: ${XRT_FEATURE_SSE2}")
message(STATUS "# FEATURE_STEAMVR_PLUGIN: ${XRT_FEATURE_STEAMVR_PLUGIN}")
message(STATUS "# FEATURE_TRACING: ${XRT_FEATURE_TRACING}")
message(STATUS "# FEATURE_WINDOW_PEEK: ${XRT_FEATURE_WINDOW_PEEK}")
message(STATUS "#")
message(STATUS "# DRIVER_ANDROID: ${XRT_BUILD_DRIVER_ANDROID}")
message(STATUS "# DRIVER_ARDUINO: ${XRT_BUILD_DRIVER_ARDUINO}")
message(STATUS "# DRIVER_DAYDREAM: ${XRT_BUILD_DRIVER_DAYDREAM}")
message(STATUS "# DRIVER_DEPTHAI: ${XRT_BUILD_DRIVER_DEPTHAI}")
message(STATUS "# DRIVER_EUROC: ${XRT_BUILD_DRIVER_EUROC}")
message(STATUS "# DRIVER_HANDTRACKING: ${XRT_BUILD_DRIVER_HANDTRACKING}")
message(STATUS "# DRIVER_HDK: ${XRT_BUILD_DRIVER_HDK}")
message(STATUS "# DRIVER_HYDRA: ${XRT_BUILD_DRIVER_HYDRA}")
message(STATUS "# DRIVER_ILLIXR: ${XRT_BUILD_DRIVER_ILLIXR}")
message(STATUS "# DRIVER_NS: ${XRT_BUILD_DRIVER_NS}")
message(STATUS "# DRIVER_OHMD: ${XRT_BUILD_DRIVER_OHMD}")
message(STATUS "# DRIVER_OPENGLOVES: ${XRT_BUILD_DRIVER_OPENGLOVES}")
message(STATUS "# DRIVER_PSMV: ${XRT_BUILD_DRIVER_PSMV}")
message(STATUS "# DRIVER_PSSENSE: ${XRT_BUILD_DRIVER_PSSENSE}")
message(STATUS "# DRIVER_PSVR: ${XRT_BUILD_DRIVER_PSVR}")
message(STATUS "# DRIVER_QWERTY: ${XRT_BUILD_DRIVER_QWERTY}")
message(STATUS "# DRIVER_REALSENSE: ${XRT_BUILD_DRIVER_REALSENSE}")
message(STATUS "# DRIVER_REMOTE: ${XRT_BUILD_DRIVER_REMOTE}")
message(STATUS "# DRIVER_RIFT_S: ${XRT_BUILD_DRIVER_RIFT_S}")
message(STATUS "# DRIVER_ROKID: ${XRT_BUILD_DRIVER_ROKID}")
message(STATUS "# DRIVER_SIMULATED: ${XRT_BUILD_DRIVER_SIMULATED}")
message(STATUS "# DRIVER_SIMULAVR: ${XRT_BUILD_DRIVER_SIMULAVR}")
message(STATUS "# DRIVER_SURVIVE: ${XRT_BUILD_DRIVER_SURVIVE}")
message(STATUS "# DRIVER_TWRAP: ${XRT_BUILD_DRIVER_TWRAP}")
message(STATUS "# DRIVER_ULV2: ${XRT_BUILD_DRIVER_ULV2}")
message(STATUS "# DRIVER_ULV5: ${XRT_BUILD_DRIVER_ULV5}")
message(STATUS "# DRIVER_VF: ${XRT_BUILD_DRIVER_VF}")
message(STATUS "# DRIVER_VIVE: ${XRT_BUILD_DRIVER_VIVE}")
message(STATUS "# DRIVER_WMR: ${XRT_BUILD_DRIVER_WMR}")
message(STATUS "# DRIVER_XREAL_AIR: ${XRT_BUILD_DRIVER_XREAL_AIR}")
message(STATUS "# DRIVER_STEAMVR_LIGHTHOUSE: ${XRT_BUILD_DRIVER_STEAMVR_LIGHTHOUSE}")
message(STATUS "#####----- Config -----#####")
# cmake-format: on
if(XRT_FEATURE_SERVICE AND NOT XRT_FEATURE_OPENXR)
message(FATAL_ERROR "XRT_FEATURE_SERVICE requires XRT_FEATURE_OPENXR to be enabled")
endif()
if(XRT_FEATURE_SERVICE AND NOT XRT_MODULE_IPC)
message(FATAL_ERROR "XRT_FEATURE_SERVICE requires XRT_MODULE_IPC to be enabled")
endif()
if(XRT_FEATURE_OPENXR_DEBUG_UTILS)
message(FATAL_ERROR "XRT_FEATURE_OPENXR_DEBUG_UTILS is not fully implemented")
endif()
if(XRT_MODULE_COMPOSITOR_MAIN AND NOT XRT_SILENCE_CMAKE_LAYER_ERRORS)
if(XRT_FEATURE_OPENXR_LAYER_CUBE)
message(
FATAL_ERROR "Main compositor doesn't support cube layer "
"(set XRT_SILENCE_CMAKE_LAYER_ERRORS to silence)"
)
endif()
if(XRT_FEATURE_OPENXR_LAYER_EQUIRECT1)
message(
FATAL_ERROR "Main compositor doesn't support equirect1 layer "
"(set XRT_SILENCE_CMAKE_LAYER_ERRORS to silence)"
)
endif()
endif()

92
CMakePresets.json Normal file
View file

@ -0,0 +1,92 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"inherits": "service-debug",
"displayName": "Default (same as service-debug)"
},
{
"name": ".base-ninja",
"generator": "Ninja",
"hidden": true,
"binaryDir": "${sourceDir}/build"
},
{
"name": "service-debug",
"displayName": "Debug service",
"inherits": ".base-ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"XRT_FEATURE_SERVICE": "ON"
}
},
{
"name": "service-debug-asan",
"displayName": "Debug service with sanitizers",
"inherits": "service-debug",
"cacheVariables": {
"SANITIZE_ADDRESS": "ON",
"SANITIZE_UNDEFINED": "ON"
}
},
{
"name": "inproc-debug",
"displayName": "Debug in-process",
"inherits": ".base-ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"XRT_FEATURE_SERVICE": "OFF"
}
},
{
"name": "service-release",
"displayName": "Release service",
"inherits": "service-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_DOC": "ON",
"BUILD_DOC_EXTRACT_ALL": "ON"
}
},
{
"name": "inproc-release",
"displayName": "Release in-process",
"inherits": "inproc-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_DOC": "ON",
"BUILD_DOC_EXTRACT_ALL": "ON"
}
},
{
"name": "service-relwithdebinfo",
"displayName": "RelWithDebInfo service",
"inherits": "service-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "inproc-relwithdebinfo",
"displayName": "RelWithDebInfo in-process",
"inherits": "inproc-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
}
],
"buildPresets": [
{
"name": "default",
"displayName": "Build and install",
"configurePreset": "default",
"targets": "install"
}
]
}

View file

@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2022 Collabora, Ltd
SPDX-License-Identifier: CC0-1.0

View file

@ -1,9 +1,15 @@
# Contribution Guidelines
<!--
Copyright 2018-2019 Collabora, Ltd.
SPDX-License-Identifier: CC-BY-4.0
-->
There are plenty of valid reasons why someone might not be able
to follow all of the guidelines in this section, and that's OK,
especially for new contributors or those new to open source entirely.
Just let us know and we'll figure out a way to help you get involved successfully.
Let us know and we'll figure out a way to help you get involved successfully.
> Important note: Unlike the guidelines here, the Code of Conduct,
> available at <https://www.freedesktop.org/wiki/CodeOfConduct/>,
@ -19,15 +25,17 @@ Just let us know and we'll figure out a way to help you get involved successfull
to begin a discussion and help smooth the acceptance of your contribution.
- If you are able, please make sure to run clang-format
(ideally version 7 or newer) before each commit,
(ideally version 11 or newer) before each commit,
so that you only commit things that are cleanly styled.
Consistent, machine-performed formatting improves readability and makes it easier for others to contribute.
It also makes it easier to review changes.
If you can't run clang-format, just mention this fact in your request and we'd be happy to help,
If you can't run clang-format, mention this fact in your request and we'd be happy to help,
either in a single "Clean up formatting." commit on top of your work,
or by "re-writing history" (with your permission and leaving your commit authorship intact),
revising each commit to apply formatting.
- Android Java and Kotlin code can be formatted using "Spotless" by running `./gradlew spotlessApply`.
- Avoid including whitespace or other formatting changes to unrelated code when committing.
The `git add -p` command or the "stage selected lines/hunks" feature of various Git GUIs are
great ways of making sure you only stage and commit the changes that you mean to.
@ -46,7 +54,12 @@ Just let us know and we'll figure out a way to help you get involved successfull
please help by making sure your changes build cleanly (and pass all tests).
When on compilers that take warning flags like gcc and clang do,
the build system automatically turns on quite a few of them.
If a warning stumps you, just mention it in the request so we can figure it out together.
If you can't figure out a warning, mention it in the request so we can figure it out together.
- We use [Proclamation](https://gitlab.com/proclamation/proclamation) to generate release notes.
After creating a merge request for a substantial change, please create one or more changelog
fragments on the branch describing the changes. See
[doc/changes/README.md](doc/changes/README.md) for more info.
### Issues
@ -70,13 +83,3 @@ bug reports should include:
otherwise a description of expected and actual behavior
- if you cannot disclose your code, or even if you can,
an "artificial", minimally-sized example can be very valuable.
---
## Copyright and License for this CONTRIBUTING.md file
For this file only:
> Copyright 2018-2019 Collabora, Ltd.
>
> SPDX-License-Identifier: CC-BY-4.0

61
CompilerFlags.cmake Normal file
View file

@ -0,0 +1,61 @@
# Copyright 2018-2023, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
if(TARGET xrt-optimized-math)
return()
endif()
# Target used for applying more aggressive optimizations to math-heavy code
add_library(xrt-optimized-math INTERFACE)
if(MSVC)
target_compile_options(xrt-optimized-math INTERFACE $<IF:$<CONFIG:Debug>,/O2 /Ob2,/O2 /Ob3>)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Werror=incompatible-pointer-types"
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
# Use effectively ubiquitous SSE2 instead of x87 floating point
# for increased reliability/consistency
if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86" AND XRT_FEATURE_SSE2)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mfpmath=sse")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse")
endif()
target_compile_options(xrt-optimized-math INTERFACE $<IF:$<CONFIG:Debug>,-O2,-O3>)
endif()
if(NOT WIN32)
# Even clang's gnu-style driver on windows doesn't accept this argument.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
endif()
# Must call before adding targets that will use xrt-optimized-math
macro(xrt_optimized_math_flags)
if(MSVC)
foreach(
FLAGSVAR
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_MINSIZEREL
)
string(REPLACE "/Od" "" ${FLAGSVAR} "${${FLAGSVAR}}")
string(REPLACE "/O1" "" ${FLAGSVAR} "${${FLAGSVAR}}")
string(REPLACE "/O2" "" ${FLAGSVAR} "${${FLAGSVAR}}")
string(REPLACE "/Ob1" "" ${FLAGSVAR} "${${FLAGSVAR}}")
string(REPLACE "/Ob0" "" ${FLAGSVAR} "${${FLAGSVAR}}")
string(REPLACE "/RTC1" "" ${FLAGSVAR} "${${FLAGSVAR}}")
endforeach()
endif()
endmacro()

11
LICENSES/Zlib.txt Normal file
View file

@ -0,0 +1,11 @@
zlib License
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

View file

@ -1,7 +1,8 @@
# Monado - XR Runtime (XRT)
<!--
Copyright 2018-2020, Collabora, Ltd.
Copyright 2018-2021, Collabora, Ltd.
SPDX-License-Identifier: CC-BY-4.0
This must stay in sync with the last section!
@ -12,7 +13,7 @@ This must stay in sync with the last section!
> * Maintained at <https://gitlab.freedesktop.org/monado/monado>
> * Latest API documentation: <https://monado.pages.freedesktop.org/monado>
> * Continuously-updated changelog of the default branch:
> <https://monado.pages.freedesktop.org/monado/md__c_h_a_n_g_e_l_o_g.html>
> <https://monado.pages.freedesktop.org/monado/_c_h_a_n_g_e_l_o_g.html>
Monado is an open source XR runtime delivering immersive experiences such as VR
and AR on mobile, PC/desktop, and any other device
@ -20,8 +21,7 @@ and AR on mobile, PC/desktop, and any other device
come up with a lot of weird hardware).
Monado aims to be a complete and conforming implementation
of the OpenXR API made by Khronos.
The project currently is being developed for GNU/Linux
and aims to support other operating systems in the near future.
The project is primarily developed on GNU/Linux, but also runs on Android and Windows.
"Monado" has no specific meaning and is just a name.
## Monado source tree
@ -38,13 +38,14 @@ and aims to support other operating systems in the near future.
Dependencies include:
* [CMake][] 3.13 or newer (Note Ubuntu 18.04 only has 3.10) or meson >= 0.49
* [CMake][] 3.13 or newer (Note Ubuntu 18.04 only has 3.10)
* Python 3.6 or newer
* Vulkan headers and loader - Fedora package `vulkan-loader-devel`
* OpenGL headers
* Eigen3
* Eigen3 - Debian/Ubuntu package `libeigen3-dev`
* glslangValidator - Debian/Ubuntu package `glslang-tools`, Fedora package `glslang`.
* libusb
* libudev - Fedora package `systemd-devel`
* libudev - Debian/Ubuntu package `libudev-dev`, Fedora package `systemd-devel`
* Video 4 Linux - Debian/Ubuntu package `libv4l-dev`.
Optional (but recommended) dependencies:
@ -54,14 +55,15 @@ Optional (but recommended) dependencies:
Truly optional dependencies, useful for some drivers, app support, etc.:
* Doxygen
* Doxygen - Debian/Ubuntu package ´doxygen´ and ´graphviz´
* Wayland development packages
* Xlib development packages
* libhidapi
* libhidapi - Debian/Ubuntu package ´libhidapi-dev´
* OpenCV
* libuvc
* ffmpeg
* libuvc - Debian/Ubuntu package ´libuvc-dev´
* libjpeg
* libbluetooth - Debian/Ubuntu package ´libbluetooth-dev´
* libsdl - Debian/Ubuntu package ´libsdl2-dev´
Experimental Windows support requires the Vulkan SDK and also needs or works
best with the following vcpkg packages installed:
@ -70,13 +72,17 @@ best with the following vcpkg packages installed:
If you have a recent [vcpkg](https://vcpkg.io) installed and use the appropriate
CMake toolchain file, the vcpkg manifest in the Monado repository will instruct
vcpkg to locally install the dependencies automatically.
vcpkg to locally install the dependencies automatically. The Vulkan SDK
installer should set the `VULKAN_SDK` Windows environment variable to point
at the installation location (for example, `C:/VulkanSDK/1.3.250.1`), though
make sure you open a new terminal (or open the CMake GUI) *after* doing that
install to make sure it is available.
Tested distributions that are fully compatible,
on Intel (Vulkan only) and AMD graphics (Vulkan and OpenGL):
Monado has been tested on these distributions, but is expected to work on almost
any modern distribution.
* Ubuntu 18.10 (18.04 does not work)
* Debian 10 `buster`
* Ubuntu 22.04, 20.04, (18.04 may not be fully supported)
* Debian 11 `bookworm`, 10 `buster`
* Up-to-date package lists can be found in our CI config file,
`.gitlab-ci.yml`
* Archlinux
@ -140,26 +146,6 @@ make install
Documentation can be browsed by opening `doc/html/index.html` in the build directory in a web browser.
### Meson
The build process is similar to other Meson builds.
For a system wide installation requiring root privileges:
```bash
meson --prefix=/usr build
ninja -C build install
```
For a local installation in ~/.local:
```bash
meson --prefix=~/.local -Dinstall-active-runtime=false build
ninja -C build install
```
Note that the installation of the `active_runtime.json` file should be disabled for installations without
root privileges because this file is always installed in meson's syconfdir (usually /etc).
## Getting started using OpenXR with Monado
This implements the [OpenXR][] API,
@ -246,10 +232,8 @@ scripts/format-project.sh
You can optionally put something like `CLANG_FORMAT=clang-format-7` before that command
if your clang-format binary isn't named `clang-format`.
**Note that you'll typically prefer** to use something like `git clang-format`
to just re-format your changes, in case version differences in tools result in overall format changes.
The CI "style" job currently runs on Debian Buster, so it has clang-format-7.
We will probably update that job to Bullseye or Ubuntu 20.10, which will allow
using clang-format-11 by default, soon.
to re-format only your changes, in case version differences in tools result in overall format changes.
The CI "style" job currently runs on Debian Bullseye, so it has clang-format-11.
[OpenHMD]: http://openhmd.net
[drm-lease]: https://haagch.frickel.club/#!drmlease%2Emd
@ -263,11 +247,12 @@ using clang-format-11 by default, soon.
## Contributing, Code of Conduct
See `CONTRIBUTING.md` for details of contribution guidelines. GitLab Issues and
Merge Requests are the preferred wait to discuss problems, suggest enhancements,
Merge Requests are the preferred way to discuss problems, suggest enhancements,
or submit changes for review. **In case of a security issue**, you should choose
the "confidential" option when using the GitLab issues page. For highest
security, you can send encrypted email (using GPG/OpenPGP) to Ryan Pavlik, with
the address below and the associated key on <https://keys.openpgp.org>.
security, you can send encrypted email (using GPG/OpenPGP) to Rylie Pavlik at
<rylie.pavlik@collabora.com> and using the associated key from
<https://keys.openpgp.org/vks/v1/by-fingerprint/45207B2B1E53E1F2755FF63CC5A2D593A61DBC9D>.
Please note that this project is released with a Contributor Code of Conduct.
By participating in this project you agree to abide by its terms.
@ -281,20 +266,12 @@ reported by contacting:
* First-line project contacts:
* Jakob Bornecrantz <jakob@collabora.com>
* Ryan Pavlik <ryan.pavlik@collabora.com>
* Rylie Pavlik <rylie.pavlik@collabora.com>
* freedesktop.org contacts: see most recent list at <https://www.freedesktop.org/wiki/CodeOfConduct/>
## Copyright and License for this README.md file
For this file only:
> Copyright 2018-2020, Collabora, Ltd.
> Code of Conduct section: excerpt adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4.1,
> available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
> and from the freedesktop.org-specific version of that code,
> available at <https://www.freedesktop.org/wiki/CodeOfConduct/>
>
>
> SPDX-License-Identifier: CC-BY-4.0
<!-- This must stay in sync with the comment at the start! -->
Code of Conduct section excerpt adapted from the
[Contributor Covenant](https://www.contributor-covenant.org), version 1.4.1,
available at
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>, and
from the freedesktop.org-specific version of that code, available at
<https://www.freedesktop.org/wiki/CodeOfConduct/>, used under CC-BY-4.0.

View file

@ -1,51 +1,79 @@
// Copyright 2020-2021, Collabora, Ltd.
// Copyright 2020-2023, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
buildscript {
ext {
kotlinVersion = '1.5.0'
kotlinVersion = '1.7.10'
// Skip 8.8.6 - see https://github.com/mikepenz/AboutLibraries/issues/648
latestAboutLibsRelease = '8.8.5'
latestAboutLibsRelease = '8.9.4'
androidxCoreVersion = "1.3.2"
androidxAnnotationVersion = '1.2.0'
androidxAppCompatVersion = "1.2.0"
androidxLifecycleVersion = "2.2.0"
androidxConstraintLayoutVersion = '2.0.4'
androidxCoreVersion = '1.8.0'
androidxAnnotationVersion = '1.3.0'
androidxAppCompatVersion = '1.5.1'
androidxLifecycleVersion = '2.5.1'
androidxConstraintLayoutVersion = '2.1.3'
androidxCardViewVersion = '1.0.0'
androidxRecyclerViewVersion = '1.2.1'
hiltVersion = '2.35.1'
hiltVersion = '2.45'
materialVersion = "1.3.0"
materialVersion = '1.8.0'
// This is the version to download if we can't find it locally.
eigenFetchVersion = '3.4.0'
// If you update this, must also update .gitlab-ci/config.yml
buildToolsVersion = '32.0.0'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
//noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${latestAboutLibsRelease}"
classpath 'com.quittle:svg-2-android-vector:0.0.5'
classpath "com.google.dagger:hilt-android-gradle-plugin:$hiltVersion"
}
}
plugins {
// Android Gradle Plugin
id 'com.android.application' version '8.1.0' apply false
id 'com.android.library' version '8.1.0' apply false
id 'org.jetbrains.kotlin.android' version "$kotlinVersion" apply false
// Used for getting the eigen dir, explicit python binary, etc. from local.properties
id 'com.github.b3er.local.properties' version '1.1'
// For getting git describe data and formatting it how Android wants.
id "com.gladed.androidgitversion" version "0.4.13"
id "com.gladed.androidgitversion" version "0.4.14"
// For downloading e.g. the CDDL (for transitive dependencies of hilt)
id "de.undercouch.download" version "4.1.1"
id "de.undercouch.download" version "4.1.2"
// So we don't have to check in generated files: we start with SVGs for vector art.
id "com.quittle.svg-2-android-vector" version "0.1.0" apply false
// Spotless for Java and Kotlin's code formatting
id 'com.diffplug.spotless' version "6.22.0"
}
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces(4)
endWithNewline()
}
}
ext {
ndk_version = '21.3.6528147'
sharedTargetSdk = 30
ndk_version = '21.4.7075529'
// If you update this, must also update .gitlab-ci/config.yml
sharedCompileSdk = 32
sharedTargetSdk = 31
sharedMinSdk = 26
// If you are building on Windows, you will need to explicitly set eigenIncludeDir in your
@ -56,10 +84,3 @@ ext {
// Python 3 explicitly in local.properties with a property named "pythonBinary"
pythonBinary = project.findProperty('pythonBinary')
}
allprojects {
repositories {
google()
mavenCentral()
}
}

View file

@ -5,14 +5,16 @@
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# 2009-2010 Rylie Pavlik <rylie@ryliepavlik.com>
# https://ryliepavlik.com/
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Copyright 2009-2010, Iowa State University.
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# SPDX-License-Identifier: BSL-1.0
if(__clean_directory_list)

View file

@ -33,10 +33,14 @@
# Since pre-1.0.0.
# SPDX-License-Identifier: BSD-3-Clause
#
# Note: This module is originally from the KDE "Extra CMake Modules" repo,
# adapted to work standalone. Original source:
# https://github.com/KDE/extra-cmake-modules/blob/3b0bf71a72789eb2b79310b4f67602115e347f56/find-modules/FindEGL.cmake
#=============================================================================
# Copyright 2014 Alex Merry <alex.merry@kde.org>
# Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
# Copyright 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
# Copyright 2019, 2021 Rylie Pavlik <rylie.pavlik@collabora.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -171,5 +175,5 @@ set(EGL_VERSION_STRING ${EGL_VERSION})
include(FeatureSummary)
set_package_properties(EGL PROPERTIES
URL "https://www.khronos.org/egl/"
DESCRIPTION "A platform-agnostic mechanism for creating rendering surfaces for use with other graphics libraries, such as OpenGL|ES and OpenVG."
DESCRIPTION "A platform-independent mechanism for creating rendering surfaces for use with other graphics libraries, such as OpenGL|ES and OpenVG."
)

View file

@ -40,15 +40,17 @@
# ``HIDAPI_LIBRARIES``
#
# Original Author:
# 2009-2010, 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# 2009-2021 Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
# https://ryliepavlik.com/
#
# Copyright 2009-2010, Iowa State University
# Copyright 2019-2021, Collabora, Ltd.
#
# Copyright Iowa State University 2009-2010.
# Copyright Collabora, Ltd. 2019, 2021.
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# SPDX-License-Identifier: BSL-1.0
set(HIDAPI_ROOT_DIR
"${HIDAPI_ROOT_DIR}"

View file

@ -1,5 +1,7 @@
# Copyright 2019-2021, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

View file

@ -1,11 +1,13 @@
# Copyright 2019, 2021 Collabora, Ltd.
# Copyright 2019-2021 Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Original Author:
# 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
# 2019-2021 Rylie Pavlik <rylie.pavlik@collabora.com>
#.rst:
# FindCheck

View file

@ -14,12 +14,14 @@
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010, 2021 Ryan Pavlik <ryanpavlik@gmail.com> <abiryan@ryand.net>
# 2009-2021 Rylie Pavlik <rylie@ryliepavlik.com>
# https://ryliepavlik.com/
#
# Copyright Iowa State University 2009-2010.
# Copyright Collabora, Ltd 2021.
# Copyright 2009-2010, Iowa State University
# Copyright 2021, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

View file

@ -1,12 +1,14 @@
# Copyright 2021, Collabora, Ltd.
# Copyright 2021-2022, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Original Author:
# 2021 Moses Turner <moses@collabora.com>
# 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
# 2021 Rylie Pavlik <rylie.pavlik@collabora.com>
#.rst:
# FindONNXRuntime
@ -50,9 +52,10 @@ find_library(
PATH_SUFFIXES lib
HINTS ${PC_ONNXRuntime_LIBRARY_DIRS})
find_path(
ONNXRuntime_INCLUDE_DIR core/session/onnxruntime_cxx_api.h
ONNXRuntime_INCLUDE_DIR onnxruntime_cxx_api.h
PATHS ${ONNXRuntime_ROOT_DIR}
PATH_SUFFIXES onnxruntime include/onnxruntime
PATH_SUFFIXES onnxruntime include include/onnxruntime onnxruntime/core/session
include/onnxruntime/core/session
HINTS ${PC_ONNXRuntime_INCLUDE_DIRS})
include(FindPackageHandleStandardArgs)

View file

@ -1,11 +1,13 @@
# Copyright 2020-2021 Collabora, Ltd.
# Copyright 2020-2021, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Original Author:
# 2020-2021 Ryan Pavlik <ryan.pavlik@collabora.com>
# 2020-2021, Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
#[[.rst:
FindOpenGLES

View file

@ -1,11 +1,13 @@
# Copyright 2019, 2021 Collabora, Ltd.
# Copyright 2019-2021 Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Original Author:
# 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
# 2019-2021 Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
#.rst:
# FindOpenHMD

View file

@ -1,11 +1,13 @@
# Copyright 2021 Collabora, Ltd.
# Copyright 2021-2022, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Original Author:
# 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
# 2021-2022 Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
#[[.rst:
FindPercetto
@ -18,7 +20,7 @@ Targets
If successful, the following imported targets are created.
* ``Percetto::percetto``
* ``percetto::percetto``
Cache variables
^^^^^^^^^^^^^^^
@ -39,32 +41,43 @@ set_package_properties(
URL "https://github.com/olvaffe/percetto/"
DESCRIPTION "A C wrapper around the C++ Perfetto tracing SDK.")
# See if we can find something made by android prefab (gradle)
include(FindPackageHandleStandardArgs)
# See if it's being built in a current project.
if(NOT Percetto_FOUND)
if(TARGET percetto::percetto)
# OK, good - this is what we wanted
elseif(TARGET Percetto::percetto)
# we now prefer lowercase
add_library(percetto::percetto INTERFACE IMPORTED)
set_target_properties(
percetto::percetto PROPERTIES INTERFACE_LINK_LIBRARIES
Percetto::percetto)
endif()
if(TARGET percetto::percetto)
set(Percetto_LIBRARY percetto::percetto)
find_package_handle_standard_args(Percetto
REQUIRED_VARS Percetto_LIBRARY)
return()
endif()
endif()
# See if we can find something made by android prefab (gradle), or exported by CMake
find_package(Percetto QUIET CONFIG NAMES percetto Percetto)
if(Percetto_FOUND)
if(TARGET Percetto::percetto)
# OK, good - unexpected, but good.
get_target_property(Percetto_LIBRARY Percetto::percetto
IMPORTED_LOCATION)
get_target_property(Percetto_INCLUDE_DIR Percetto::percetto
INTERFACE_INCLUDE_DIRECTORIES)
elseif(TARGET percetto::percetto)
# Let's make our own of the right name
add_library(Percetto::percetto STATIC IMPORTED)
get_target_property(Percetto_INCLUDE_DIR percetto::percetto
INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(Percetto_LIBRARY percetto::percetto
IMPORTED_LOCATION)
find_package_handle_standard_args(Percetto CONFIG_MODE)
if(TARGET percetto::percetto)
# OK, good - this is what we wanted
elseif(TARGET Percetto::percetto)
# we now prefer lowercase
add_library(percetto::percetto INTERFACE IMPORTED)
set_target_properties(
Percetto::percetto
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Percetto_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION ${Percetto_LIBRARY})
percetto::percetto PROPERTIES INTERFACE_LINK_LIBRARIES
Percetto::percetto)
else()
message(FATAL_ERROR "assumptions failed")
endif()
find_package_handle_standard_args(
Percetto REQUIRED_VARS Percetto_LIBRARY Percetto_INCLUDE_DIR)
return()
endif()
@ -96,15 +109,14 @@ find_library(
HINTS ${PC_percetto_LIBRARY_DIRS}
PATH_SUFFIXES lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Percetto REQUIRED_VARS Percetto_INCLUDE_DIR
Percetto_LIBRARY)
if(Percetto_FOUND)
if(NOT TARGET Percetto::percetto)
add_library(Percetto::percetto STATIC IMPORTED)
if(NOT TARGET percetto::percetto)
add_library(percetto::percetto UNKNOWN IMPORTED)
set_target_properties(
Percetto::percetto
percetto::percetto
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Percetto_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION ${Percetto_LIBRARY})

View file

@ -18,12 +18,43 @@
# Copyright (c) 2020-2021 Collabora, Ltd.
#
# Distributed under the OSI-approved BSD License (the "License");
# see below.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
#
# SPDX-License-Identifier: BSD-3-Clause
#=============================================================================
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
include(FeatureSummary)
set_package_properties(

68
cmake/Findbluetooth.cmake Normal file
View file

@ -0,0 +1,68 @@
# Copyright 2022, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Original Author:
# 2022 Daniel Willmott <web@dan-w.com>
#.rst:
# Findbluetooth
# ---------------
#
# Find the bluetooth library
#
# Targets
# ^^^^^^^
#
# If successful, the following import target is created.
#
# ``bluetooth::bluetooth``
#
# Cache variables
# ^^^^^^^^^^^^^^^
#
# The following cache variable may also be set to assist/control the operation of this module:
#
# ``BLUETOOTH_ROOT_DIR``
# The root to search for bluetooth
set(bluetooth_ROOT_DIR
"${bluetooth_ROOT_DIR}"
CACHE
PATH
"Directory to search for the BlueZ bluetooth library")
find_package(PkgConfig)
pkg_check_modules(PC_BLUETOOTH QUIET bluetooth bluez)
find_path(bluetooth_INCLUDE_DIR
NAMES bluetooth/bluetooth.h
PATHS ${bluetooth_ROOT_DIR}
HINTS ${PC_BLUETOOTH_INCLUDE_DIRS})
find_library(
bluetooth_LIBRARY
NAMES bluetooth libbluetooth
PATHS ${bluetooth_ROOT_DIR}
HINTS ${PC_BLUETOOTH_LIBDIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(bluetooth
REQUIRED_VARS bluetooth_LIBRARY bluetooth_INCLUDE_DIR)
if (bluetooth_FOUND)
set(bluetooth_INCLUDE_DIRS ${bluetooth_INCLUDE_DIR})
set(bluetooth_LIBRARIES ${bluetooth_LIBRARY})
if (NOT TARGET bluetooth::bluetooth)
add_library(bluetooth::bluetooth UNKNOWN IMPORTED)
set_target_properties(bluetooth::bluetooth PROPERTIES
IMPORTED_LOCATION "${bluetooth_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${bluetooth_INCLUDE_DIR}")
endif ()
endif()
mark_as_advanced(bluetooth_INCLUDE_DIR bluetooth_LIBRARY)

View file

@ -1,11 +1,13 @@
# Copyright 2019-2020, Collabora, Ltd.
# Copyright 2019-2022, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Original Author:
# 2019-2020 Ryan Pavlik <ryan.pavlik@collabora.com>
# 2019-2022 Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
#.rst:
# FindcJSON
@ -32,31 +34,52 @@ set(CJSON_ROOT_DIR
"${CJSON_ROOT_DIR}"
CACHE PATH "Root to search for cJSON")
find_path(
CJSON_INCLUDE_DIR
NAMES cjson/cJSON.h
PATHS ${CJSON_ROOT_DIR}
PATH_SUFFIXES include)
find_library(
CJSON_LIBRARY
NAMES cjson
PATHS ${CJSON_ROOT_DIR}
PATH_SUFFIXES lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(cJSON REQUIRED_VARS CJSON_INCLUDE_DIR
CJSON_LIBRARY)
# Check for CMake config first.
find_package(cJSON QUIET CONFIG)
if(cJSON_FOUND AND TARGET cjson)
set_target_properties(cjson PROPERTIES IMPORTED_GLOBAL TRUE)
# Found config, let's prefer it.
find_package_handle_standard_args(cJSON CONFIG_MODE)
set(CJSON_LIBRARY cjson)
else()
# Manually find
find_path(
CJSON_INCLUDE_DIR
NAMES cjson/cJSON.h
PATHS ${CJSON_ROOT_DIR}
PATH_SUFFIXES include)
find_library(
CJSON_LIBRARY
NAMES cjson
PATHS ${CJSON_ROOT_DIR}
PATH_SUFFIXES lib)
find_package_handle_standard_args(cJSON REQUIRED_VARS CJSON_INCLUDE_DIR
CJSON_LIBRARY)
endif()
if(CJSON_FOUND)
set(CJSON_INCLUDE_DIRS "${CJSON_INCLUDE_DIR}")
set(CJSON_LIBRARIES "${CJSON_LIBRARY}")
if(NOT TARGET cJSON::cJSON)
add_library(cJSON::cJSON UNKNOWN IMPORTED)
if(TARGET "${CJSON_LIBRARY}")
# Alias if we found the config file
add_library(cJSON::cJSON ALIAS cjson)
else()
add_library(cJSON::cJSON UNKNOWN IMPORTED)
set_target_properties(
cJSON::cJSON PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${CJSON_INCLUDE_DIR}")
set_target_properties(
cJSON::cJSON PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${CJSON_LIBRARY}")
endif()
endif()
set_target_properties(cJSON::cJSON PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${CJSON_INCLUDE_DIR}")
set_target_properties(
cJSON::cJSON PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${CJSON_LIBRARY}")
mark_as_advanced(CJSON_INCLUDE_DIR CJSON_LIBRARY)
endif()
mark_as_advanced(CJSON_ROOT_DIR)

View file

@ -14,8 +14,8 @@
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Authors:
# 2014 Kevin M. Godby <kevin@godby.org>
# 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
# 2014, Kevin M. Godby <kevin@godby.org>
# 2021, Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
#
# Copyright 2014, Kevin M. Godby <kevin@godby.org>
# Copyright 2021, Collabora, Ltd.

View file

@ -0,0 +1,148 @@
# Copyright 2019-2023, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Maintained by:
# 2019-2023 Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
#[[.rst:
GenerateKhrManifest
-------------------
This is a utility module, usually wrapped by more usage-specific modules.
The general goal is to be able to generate a (JSON) manifest describing targets
with some absolute, relative, or unspecified path, such as required by the OpenXR
and Vulkan loaders for runtimes and API layers.
The following functions are provided by this module:
- :command:`generate_khr_manifest_buildtree`
- :command:`generate_khr_manifest_at_install`
.. command:: generate_khr_manifest_buildtree
Generates a manifest suitable for use in the build tree,
with absolute paths, at configure time::
generate_khr_manifest_buildtree(
MANIFEST_TEMPLATE <template> # The template for your manifest file
TARGET <target> # Name of your target (layer, runtime, etc)
OUT_FILE <outfile> # Name of the manifest file (with path) to generate
MANIFEST_DESCRIPTION "<desc>" # A brief description of the thing we're generating (e.g. "Vulkan API layer manifest")
)
.. command:: generate_khr_manifest_at_install
Generates a manifest at install time and installs it where desired::
generate_khr_manifest_at_install(
MANIFEST_TEMPLATE <template> # The template for your manifest file
TARGET <target> # Name of your target (layer, runtime, etc)
DESTINATION <dest> # The install-prefix-relative path to install the manifest to.
RELATIVE_TARGET_DIR <dir> # The install-prefix-relative path that the target library is installed to.
MANIFEST_DESCRIPTION "<desc>" # A brief description of the thing we're generating (e.g. "Vulkan API layer manifest")
[COMPONENT <comp>] # If present, the component to place the manifest in.
[ABSOLUTE_TARGET_PATH| # If present, path in generated manifest is absolute
TARGET_DIR_RELATIVE_TO_MANIFEST <dir>]
# If present (and ABSOLUTE_TARGET_PATH not present), specifies the
# target directory relative to the manifest directory in the installed layout
[OUT_FILENAME <outfilename> # Optional: Alternate name of the manifest file to generate (defaults to target name + .json)
)
#]]
get_filename_component(_KHR_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}"
PATH)
set(_KHR_MANIFEST_SCRIPT
"${_KHR_MANIFEST_CMAKE_DIR}/GenerateKhrManifestInternals.cmake.in"
CACHE INTERNAL "" FORCE)
function(generate_khr_manifest_buildtree)
set(options)
set(oneValueArgs MANIFEST_TEMPLATE TARGET OUT_FILE MANIFEST_DESCRIPTION)
set(multiValueArgs)
cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
if(NOT _genmanifest_MANIFEST_TEMPLATE)
message(FATAL_ERROR "Need MANIFEST_TEMPLATE specified!")
endif()
if(NOT _genmanifest_TARGET)
message(FATAL_ERROR "Need TARGET specified!")
endif()
if(NOT _genmanifest_OUT_FILE)
message(FATAL_ERROR "Need OUT_FILE specified!")
endif()
if(NOT _genmanifest_MANIFEST_DESCRIPTION)
message(FATAL_ERROR "Need MANIFEST_DESCRIPTION specified!")
endif()
# Set template values
set(_genmanifest_INTERMEDIATE_MANIFEST
${CMAKE_CURRENT_BINARY_DIR}/intermediate_manifest_buildtree_${_genmanifest_TARGET}.json
)
set(_genmanifest_IS_INSTALL OFF)
set(_script
${CMAKE_CURRENT_BINARY_DIR}/make_build_manifest_${_genmanifest_TARGET}.cmake
)
configure_file("${_KHR_MANIFEST_SCRIPT}" "${_script}" @ONLY)
add_custom_command(
TARGET ${_genmanifest_TARGET}
POST_BUILD
BYPRODUCTS "${_genmanifest_OUT_FILE}"
COMMAND
"${CMAKE_COMMAND}" "-DOUT_FILE=${_genmanifest_OUT_FILE}"
"-DTARGET_PATH=$<TARGET_FILE:${_genmanifest_TARGET}>" -P
"${_script}" DEPENDS "${_script}"
COMMENT
"Generating ${_genmanifest_MANIFEST_DESCRIPTION} named ${_genmanifest_OUT_FILE} for build tree usage"
)
endfunction()
function(generate_khr_manifest_at_install)
set(options ABSOLUTE_TARGET_PATH)
set(oneValueArgs
MANIFEST_TEMPLATE
TARGET
DESTINATION
OUT_FILENAME
TARGET_DIR_RELATIVE_TO_MANIFEST
RELATIVE_TARGET_DIR
MANIFEST_DESCRIPTION
COMPONENT)
set(multiValueArgs)
cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
if(NOT _genmanifest_MANIFEST_TEMPLATE)
message(FATAL_ERROR "Need MANIFEST_TEMPLATE specified!")
endif()
if(NOT _genmanifest_TARGET)
message(FATAL_ERROR "Need TARGET specified!")
endif()
if(NOT _genmanifest_DESTINATION)
message(FATAL_ERROR "Need DESTINATION specified!")
endif()
if(NOT _genmanifest_RELATIVE_TARGET_DIR)
message(FATAL_ERROR "Need RELATIVE_TARGET_DIR specified!")
endif()
if(NOT _genmanifest_OUT_FILENAME)
set(_genmanifest_OUT_FILENAME "${_genmanifest_TARGET}.json")
endif()
if(NOT _genmanifest_COMPONENT)
set(_genmanifest_COMPONENT Unspecified)
endif()
set(_genmanifest_INTERMEDIATE_MANIFEST
"${CMAKE_CURRENT_BINARY_DIR}/${_genmanifest_OUT_FILENAME}")
set(_genmanifest_IS_INSTALL ON)
# Template value
set(TARGET_FILENAME
${CMAKE_SHARED_MODULE_PREFIX}${_genmanifest_TARGET}${CMAKE_SHARED_MODULE_SUFFIX}
)
set(_script
${CMAKE_CURRENT_BINARY_DIR}/make_manifest_${_genmanifest_TARGET}.cmake)
configure_file("${_KHR_MANIFEST_SCRIPT}" "${_script}" @ONLY)
install(SCRIPT "${_script}" COMPONENT ${_genmanifest_COMPONENT})
endfunction()

View file

@ -0,0 +1,70 @@
# Copyright 2019-2022, Collabora, Ltd.
# Copyright 2019, Benjamin Saunders <ben.e.saunders@gmail.com>
#
# SPDX-License-Identifier: BSL-1.0
#
# Maintained by:
# 2019-2022 Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
# Get input from main CMake script
set(MANIFEST_TEMPLATE @_genmanifest_MANIFEST_TEMPLATE@)
set(DESTINATION @_genmanifest_DESTINATION@)
set(OUT_FILENAME @_genmanifest_OUT_FILENAME@)
set(CONFIGURE_OUTPUT_FILE @_genmanifest_INTERMEDIATE_MANIFEST@)
set(IS_INSTALL @_genmanifest_IS_INSTALL@)
set(MANIFEST_DESCRIPTION "@_genmanifest_MANIFEST_DESCRIPTION@")
set(TARGET @_genmanifest_TARGET@)
# Target install dir relative to install prefix
set(RELATIVE_TARGET_DIR @_genmanifest_RELATIVE_TARGET_DIR@)
# Target so/dll filename
set(TARGET_FILENAME @TARGET_FILENAME@)
# The relative path from the manifest dir to the library. Optional.
set(TARGET_DIR_RELATIVE_TO_MANIFEST
@_genmanifest_TARGET_DIR_RELATIVE_TO_MANIFEST@)
# Config option
set(ABSOLUTE_TARGET_PATH @_genmanifest_ABSOLUTE_TARGET_PATH@)
if(TARGET_PATH)
# This is at build time, not install time
set(CONFIGURE_OUTPUT_FILE "${OUT_FILE}")
elseif(ABSOLUTE_TARGET_PATH)
# Absolute path to TARGET
message(
STATUS
"Installing ${MANIFEST_DESCRIPTION} with absolute path to library")
set(TARGET_PATH ${RELATIVE_TARGET_DIR}/${TARGET_FILENAME})
if(NOT IS_ABSOLUTE ${RELATIVE_TARGET_DIR})
set(TARGET_PATH ${CMAKE_INSTALL_PREFIX}/${TARGET_PATH})
endif()
elseif(TARGET_DIR_RELATIVE_TO_MANIFEST)
# Relative path to target.
message(
STATUS
"Installing ${MANIFEST_DESCRIPTION} with JSON-relative path to library"
)
set(TARGET_PATH ${TARGET_DIR_RELATIVE_TO_MANIFEST}/${TARGET_FILENAME})
else()
# Unqualified filename: requires it exist on the system shared library search path.
message(
STATUS
"Installing ${MANIFEST_DESCRIPTION} with unqualified library filename (uses system search path)"
)
set(TARGET_PATH ${TARGET_FILENAME})
endif()
if(WIN32)
# Windows really wants backslashes in the manifest, and they must be escaped.
string(REPLACE "/" [[\\]] TARGET_PATH ${TARGET_PATH})
endif()
set(target_path ${TARGET_PATH})
# Create manifest
configure_file("${MANIFEST_TEMPLATE}" "${CONFIGURE_OUTPUT_FILE}")
if(IS_INSTALL)
# Install it
file(
INSTALL
DESTINATION "${CMAKE_INSTALL_PREFIX}/${DESTINATION}"
TYPE FILE FILES "${CONFIGURE_OUTPUT_FILE}")
endif()

View file

@ -0,0 +1,145 @@
# Copyright 2019-2023, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Maintained by:
# 2019-2023 Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
#[[.rst:
GenerateOpenXRRuntimeManifest
---------------
The following functions are provided by this module:
- :command:`generate_openxr_runtime_manifest_buildtree`
- :command:`generate_openxr_runtime_manifest_at_install`
.. command:: generate_openxr_runtime_manifest_buildtree
Generates a runtime manifest suitable for use in the build tree,
with absolute paths, at configure time::
generate_openxr_runtime_manifest_buildtree(
RUNTIME_TARGET <target> # Name of your runtime target
OUT_FILE <outfile> # Name of the manifest file (with path) to generate
[MANIFEST_TEMPLATE <template>] # Optional: Specify an alternate template to use
)
.. command:: generate_openxr_runtime_manifest_at_install
Generates a runtime manifest at install time and installs it where desired::
generate_openxr_runtime_manifest_buildtree(
RUNTIME_TARGET <target> # Name of your runtime target
DESTINATION <dest> # The install-prefix-relative path to install the manifest to.
RELATIVE_RUNTIME_DIR <dir> # The install-prefix-relative path that the runtime library is installed to.
[COMPONENT <comp>] # If present, the component to place the manifest in.
[ABSOLUTE_RUNTIME_PATH| # If present, path in generated manifest is absolute
RUNTIME_DIR_RELATIVE_TO_MANIFEST <dir>]
# If present (and ABSOLUTE_RUNTIME_PATH not present), specifies the
# runtime directory relative to the manifest directory in the installed layout
[OUT_FILENAME <outfilename> # Optional: Alternate name of the manifest file to generate
[MANIFEST_TEMPLATE <template>] # Optional: Specify an alternate template to use
)
#]]
# This module is mostly just argument parsing, the guts are in GenerateKhrManifest
get_filename_component(_OXR_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}"
PATH)
include("${_OXR_MANIFEST_CMAKE_DIR}/GenerateKhrManifest.cmake")
set(_OXR_MANIFEST_TEMPLATE
"${_OXR_MANIFEST_CMAKE_DIR}/openxr_manifest.in.json"
CACHE INTERNAL "" FORCE)
function(generate_openxr_runtime_manifest_buildtree)
set(options)
set(oneValueArgs MANIFEST_TEMPLATE RUNTIME_TARGET OUT_FILE)
set(multiValueArgs)
cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
if(NOT _genmanifest_MANIFEST_TEMPLATE)
set(_genmanifest_MANIFEST_TEMPLATE "${_OXR_MANIFEST_TEMPLATE}")
endif()
if(NOT _genmanifest_RUNTIME_TARGET)
message(FATAL_ERROR "Need RUNTIME_TARGET specified!")
endif()
if(NOT _genmanifest_OUT_FILE)
message(FATAL_ERROR "Need OUT_FILE specified!")
endif()
generate_khr_manifest_buildtree(
MANIFEST_DESCRIPTION
"OpenXR runtime manifest"
MANIFEST_TEMPLATE
"${_genmanifest_MANIFEST_TEMPLATE}"
TARGET
"${_genmanifest_RUNTIME_TARGET}"
OUT_FILE
"${_genmanifest_OUT_FILE}")
endfunction()
function(generate_openxr_runtime_manifest_at_install)
set(options ABSOLUTE_RUNTIME_PATH)
set(oneValueArgs
MANIFEST_TEMPLATE
DESTINATION
OUT_FILENAME
COMPONENT
RUNTIME_TARGET
RUNTIME_DIR_RELATIVE_TO_MANIFEST
RELATIVE_RUNTIME_DIR)
set(multiValueArgs)
cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
if(NOT _genmanifest_MANIFEST_TEMPLATE)
set(_genmanifest_MANIFEST_TEMPLATE "${_OXR_MANIFEST_TEMPLATE}")
endif()
if(NOT _genmanifest_RUNTIME_TARGET)
message(FATAL_ERROR "Need RUNTIME_TARGET specified!")
endif()
if(NOT _genmanifest_DESTINATION)
message(FATAL_ERROR "Need DESTINATION specified!")
endif()
if(NOT _genmanifest_RELATIVE_RUNTIME_DIR)
message(FATAL_ERROR "Need RELATIVE_RUNTIME_DIR specified!")
endif()
if(NOT _genmanifest_OUT_FILENAME)
set(_genmanifest_OUT_FILENAME "${_genmanifest_RUNTIME_TARGET}.json")
endif()
set(_genmanifest_fwdargs)
if(_genmanifest_ABSOLUTE_RUNTIME_PATH)
list(APPEND _genmanifest_fwdargs ABSOLUTE_TARGET_PATH)
endif()
if(_genmanifest_RUNTIME_DIR_RELATIVE_TO_MANIFEST)
list(APPEND _genmanifest_fwdargs TARGET_DIR_RELATIVE_TO_MANIFEST
"${_genmanifest_RUNTIME_DIR_RELATIVE_TO_MANIFEST}")
endif()
if(_genmanifest_COMPONENT)
list(APPEND _genmanifest_fwdargs COMPONENT "${_genmanifest_COMPONENT}")
endif()
generate_khr_manifest_at_install(
${_genmanifest_fwdargs}
MANIFEST_DESCRIPTION
"OpenXR runtime manifest"
MANIFEST_TEMPLATE
"${_genmanifest_MANIFEST_TEMPLATE}"
TARGET
"${_genmanifest_RUNTIME_TARGET}"
DESTINATION
"${_genmanifest_DESTINATION}"
RELATIVE_TARGET_DIR
"${_genmanifest_RELATIVE_RUNTIME_DIR}"
OUT_FILENAME
"${_genmanifest_OUT_FILENAME}")
endfunction()

View file

@ -0,0 +1,140 @@
# Copyright 2019-2023, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
#
# Maintained by:
# 2019-2023 Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
#[[.rst:
GenerateVulkanApiLayerManifest
---------------
The following functions are provided by this module:
- :command:`generate_vulkan_api_layer_manifest_buildtree`
- :command:`generate_vulkan_api_layer_manifest_at_install`
.. command:: generate_vulkan_api_layer_manifest_buildtree
Generates a layer manifest suitable for use in the build tree,
with absolute paths, at configure time::
generate_vulkan_api_layer_manifest_buildtree(
MANIFEST_TEMPLATE <template> # The template for your manifest file
LAYER_TARGET <target> # Name of your layer target
OUT_FILE <outfile> # Name of the manifest file (with path) to generate
)
.. command:: generate_vulkan_api_layer_manifest_at_install
Generates a layer manifest at install time and installs it where desired::
generate_vulkan_api_layer_manifest_at_install(
MANIFEST_TEMPLATE <template> # The template for your manifest file
LAYER_TARGET <target> # Name of your layer target
DESTINATION <dest> # The install-prefix-relative path to install the manifest to.
RELATIVE_LAYER_DIR <dir> # The install-prefix-relative path that the layer library is installed to.
[COMPONENT <comp>] # If present, the component to place the manifest in.
[ABSOLUTE_LAYER_PATH| # If present, path in generated manifest is absolute
LAYER_DIR_RELATIVE_TO_MANIFEST <dir>]
# If present (and ABSOLUTE_LAYER_PATH not present), specifies the
# layer directory relative to the manifest directory in the installed layout
[OUT_FILENAME <outfilename> # Optional: Alternate name of the manifest file to generate
)
#]]
# This module is mostly just argument parsing, the guts are in GenerateKhrManifest
get_filename_component(_VK_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include("${_VK_MANIFEST_CMAKE_DIR}/GenerateKhrManifest.cmake")
function(generate_vulkan_api_layer_manifest_buildtree)
set(options)
set(oneValueArgs MANIFEST_TEMPLATE LAYER_TARGET OUT_FILE)
set(multiValueArgs)
cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
if(NOT _genmanifest_MANIFEST_TEMPLATE)
message(FATAL_ERROR "Need MANIFEST_TEMPLATE specified!")
endif()
if(NOT _genmanifest_LAYER_TARGET)
message(FATAL_ERROR "Need LAYER_TARGET specified!")
endif()
if(NOT _genmanifest_OUT_FILE)
message(FATAL_ERROR "Need OUT_FILE specified!")
endif()
generate_khr_manifest_buildtree(
MANIFEST_DESCRIPTION
"Vulkan API layer manifest"
MANIFEST_TEMPLATE
"${_genmanifest_MANIFEST_TEMPLATE}"
TARGET
"${_genmanifest_LAYER_TARGET}"
OUT_FILE
"${_genmanifest_OUT_FILE}")
endfunction()
function(generate_vulkan_api_layer_manifest_at_install)
set(options ABSOLUTE_LAYER_PATH)
set(oneValueArgs
MANIFEST_TEMPLATE
DESTINATION
OUT_FILENAME
COMPONENT
LAYER_TARGET
LAYER_DIR_RELATIVE_TO_MANIFEST
RELATIVE_LAYER_DIR)
set(multiValueArgs)
cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
if(NOT _genmanifest_MANIFEST_TEMPLATE)
message(FATAL_ERROR "Need MANIFEST_TEMPLATE specified!")
endif()
if(NOT _genmanifest_LAYER_TARGET)
message(FATAL_ERROR "Need LAYER_TARGET specified!")
endif()
if(NOT _genmanifest_DESTINATION)
message(FATAL_ERROR "Need DESTINATION specified!")
endif()
if(NOT _genmanifest_RELATIVE_LAYER_DIR)
message(FATAL_ERROR "Need RELATIVE_LAYER_DIR specified!")
endif()
if(NOT _genmanifest_OUT_FILENAME)
set(_genmanifest_OUT_FILENAME "${_genmanifest_LAYER_TARGET}.json")
endif()
set(_genmanifest_fwdargs)
if(_genmanifest_ABSOLUTE_LAYER_PATH)
list(APPEND _genmanifest_fwdargs ABSOLUTE_TARGET_PATH)
endif()
if(_genmanifest_LAYER_DIR_RELATIVE_TO_MANIFEST)
list(APPEND _genmanifest_fwdargs TARGET_DIR_RELATIVE_TO_MANIFEST
"${_genmanifest_LAYER_DIR_RELATIVE_TO_MANIFEST}")
endif()
if(_genmanifest_COMPONENT)
list(APPEND _genmanifest_fwdargs COMPONENT "${_genmanifest_COMPONENT}")
endif()
generate_khr_manifest_at_install(
${_genmanifest_fwdargs}
MANIFEST_DESCRIPTION
"Vulkan API layer manifest"
MANIFEST_TEMPLATE
"${_genmanifest_MANIFEST_TEMPLATE}"
TARGET
"${_genmanifest_LAYER_TARGET}"
DESTINATION
"${_genmanifest_DESTINATION}"
RELATIVE_TARGET_DIR
"${_genmanifest_RELATIVE_LAYER_DIR}"
OUT_FILENAME
"${_genmanifest_OUT_FILENAME}")
endfunction()

View file

@ -32,13 +32,15 @@
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2020 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# 2009-2020 Rylie Pavlik <rylie@ryliepavlik.com>
# https://ryliepavlik.com/
#
# Copyright 2009-2013, Iowa State University.
# Copyright 2013-2020, Ryan Pavlik
# Copyright 2013-2020, Rylie Pavlik
# Copyright 2013-2020, Contributors
#
# SPDX-License-Identifier: BSL-1.0
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
@ -94,7 +96,8 @@ function(get_git_head_revision _refspecvar _hashvar)
if(NOT "${GIT_DIR}" STREQUAL "")
file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}"
"${GIT_DIR}")
if("${_relative_to_source_dir}" MATCHES "[.][.]" AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR)
if("${_relative_to_source_dir}" MATCHES "[.][.]"
AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR)
# We've gone above the CMake root dir.
set(GIT_DIR "")
endif()
@ -143,6 +146,16 @@ function(get_git_head_revision _refspecvar _hashvar)
string(REGEX REPLACE "gitdir: (.*)$" "\\1" git_worktree_dir
${worktree_ref})
string(STRIP ${git_worktree_dir} git_worktree_dir)
# When running in an msys environment, the git_worktree_dir has to be
# converted to windows format, by adding the windows prefix of the
# msys root dir.
if(MINGW)
execute_process(
COMMAND bash -c "cygpath.exe -m /"
OUTPUT_VARIABLE real_root
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(git_worktree_dir "${real_root}${git_worktree_dir}")
endif()
_git_find_closest_git_dir("${git_worktree_dir}" GIT_DIR)
set(HEAD_SOURCE_FILE "${git_worktree_dir}/HEAD")
endif()

View file

@ -4,14 +4,17 @@
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# 2009-2023 Rylie Pavlik <rylie@ryliepavlik.com>
# https://ryliepavlik.com/
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Copyright 2009-2012, Iowa State University
# Copyright 2011-2023, Contributors
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# SPDX-License-Identifier: BSL-1.0
set(HEAD_HASH)
@ -20,23 +23,26 @@ file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
if(EXISTS "@GIT_DIR@/packed-refs")
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs"
COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()

167
cmake/OptionWithDeps.cmake Normal file
View file

@ -0,0 +1,167 @@
# Copyright 2022, Collabora, Ltd.
# Copyright 2000-2022, Kitware, Inc., Insight Software Consortium
#
# SPDX-License-Identifier: BSD-3-Clause
#
# CMake was initially developed by Kitware with the following sponsorship:
# * National Library of Medicine at the National Institutes of Health
# as part of the Insight Segmentation and Registration Toolkit (ITK).
#
# * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
# Visualization Initiative.
#
# * National Alliance for Medical Image Computing (NAMIC) is funded by the
# National Institutes of Health through the NIH Roadmap for Medical Research,
# Grant U54 EB005149.
#
# * Kitware, Inc.
#
# (Based on CMakeDependentOption)
#[=======================================================================[.rst:
OptionWithDeps
--------------
Macro to provide an option dependent on other options.
This macro presents an option to the user only if a set of other
conditions are true. If it is already specified by the user but the
conditions are not true, it triggers an error.
This is based on cmake_dependent_options but meets common expectations better:
if you explicitly try to enable something that is not available, you get an error
instead of having it silently disabled.
.. command:: option_with_deps
.. code-block:: cmake
option_with_deps(<option> "<help_text>" [DEFAULT <default>] DEPENDS [<depends>...])
Describes a build option that has dependencies. If the option is requested,
but the depends are not satisfied, an error is issued. DEPENDS is a list of
conditions to check: all must be true to make the option available.
Otherwise, a local variable named ``<option>`` is set to ``OFF``.
When ``<option>`` is available, the given ``<help_text>`` and initial
``<default>`` are used. Otherwise, any value set by the user is preserved for
when ``<depends>`` is satisfied in the future.
Note that the ``<option>`` variable only has a value which satisfies the
``<depends>`` condition within the scope of the caller because it is a local
variable.
Elements of ``<depends>`` cannot contain parentheses nor "AND" (each item is
implicitly "ANDed" together). Be sure to quote OR and NOT expressions, and avoid
complex expressions (such as with escaped quotes, etc) since they may fail,
especially before CMake 3.18.
Example invocation:
.. code-block:: cmake
option_with_deps(USE_PACKAGE_ABC "Use Abc" DEPENDS "USE_PACKAGE_XYZ" "NOT USE_CONFLICTING_PACKAGE")
If ``USE_PACKAGE_XYZ`` is true and ``USE_CONFLICTING_PACKAGE`` is false, this provides
an option called ``USE_PACKAGE_ABC`` that defaults to ON. Otherwise, it sets
``USE_PACKAGE_ABC`` to OFF and hides the option from the user. If the status of
``USE_PACKAGE_XYZ`` or ``USE_CONFLICTING_PACKAGE`` ever changes, any value for the
``USE_PACKAGE_ABC`` option is saved so that when the option is re-enabled it retains
its old value.
#]=======================================================================]
function(option_with_deps option doc)
set(options)
set(oneValueArgs DEFAULT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_option_deps "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
if(NOT DEFINED _option_deps_DEFAULT)
set(_option_deps_DEFAULT ON)
endif()
# Check for invalid/bad depends args
foreach(d ${_option_deps_DEPENDS})
if("${d}" MATCHES "[(]")
message(
FATAL_ERROR "option_with_deps does not support parens in deps")
endif()
if("${d}" MATCHES "\\bAND\\b")
message(
FATAL_ERROR
"option_with_deps treats every deps item as being implicitly 'ANDed' together"
)
endif()
if("${d}" STREQUAL "OR")
message(FATAL_ERROR "option_with_deps needs OR expressions quoted")
endif()
if("${d}" STREQUAL "NOT")
message(FATAL_ERROR "option_with_deps needs NOT expressions quoted")
endif()
endforeach()
# This is a case we removed from the original CMakeDependentOption module
if(NOT (${option}_ISSET MATCHES "^${option}_ISSET$"))
message(
FATAL_ERROR
"Probably too old of CMake version to cope with this module")
endif()
# Check the actual deps, determine if the option is available
set(_avail ON)
foreach(d ${_option_deps_DEPENDS})
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.18)
cmake_language(
EVAL
CODE
"
if(${d})
else()
set(_avail OFF)
set(_cond ${d})
endif()")
else()
# cmake_language(EVAL CODE was added in 3.18 so evaluate it the "old" way before then.
# turn spaces into semicolons so we have a list of arguments, signalling to CMAKE
# to interpret the "if()" differently
string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
if(${CMAKE_DEPENDENT_OPTION_DEP})
else()
set(_avail OFF)
set(_cond ${d})
endif()
endif()
endforeach()
# Error if option was requested but not available
if("${${option}}" AND NOT "${_avail}")
message(
FATAL_ERROR
"${option} specified but not available: failed check ${_cond}")
endif()
# Handle remaining cases
set(_already_defined OFF)
if(DEFINED ${option})
set(_already_defined ON)
endif()
if(${_avail})
# Set a cache variable: the value here will not override an already-set value.
option(${option} "${doc}" "${_option_deps_DEFAULT}")
if(NOT _already_defined)
# Needed to force this for some reason
set(${option}
"${${option}}"
CACHE BOOL "${doc}" FORCE)
endif()
else()
# Don't set a cache variable for something that's not available
set(${option}
OFF
PARENT_SCOPE)
endif()
endfunction()

View file

@ -2,14 +2,16 @@
#
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# 2009-2010 Rylie Pavlik <rylie@ryliepavlik.com>
# https://ryliepavlik.com/
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Copyright 2009-2010, Iowa State University
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# SPDX-License-Identifier: BSL-1.0
if(__prefix_list_glob)

View file

@ -5,14 +5,16 @@
# PrefixListGlob
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# 2009-2010 Rylie Pavlik <rylie@ryliepavlik.com>
# https://ryliepavlik.com/
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Copyright 2009-2010, Iowa State University
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# SPDX-License-Identifier: BSL-1.0
include(PrefixListGlob)

View file

@ -1,4 +1,5 @@
# Copyright 2019, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
find_program(GLSLANGVALIDATOR_COMMAND
@ -7,30 +8,29 @@ if(NOT GLSLANGVALIDATOR_COMMAND)
message(FATAL_ERROR "glslangValidator required - source maintained at https://github.com/KhronosGroup/glslang")
endif()
#
# Generate a SPIR-V header file, with the given var name. Returns the header.
#
function(spirv_shader ret GLSL VAR)
set(HEADER "${CMAKE_CURRENT_BINARY_DIR}/${GLSL}.h")
set(GLSL "${CMAKE_CURRENT_SOURCE_DIR}/${GLSL}")
add_custom_command(
OUTPUT ${HEADER}
COMMAND ${GLSLANGVALIDATOR_COMMAND} -V ${GLSL} --vn ${VAR} -o ${HEADER}
DEPENDS ${GLSL})
set(${ret} "${HEADER}" PARENT_SCOPE)
endfunction(spirv_shader)
#
# Generate SPIR-V header files from the arguments. Returns a list of headers.
#
function(spirv_shaders ret)
set(options)
set(oneValueArgs SPIRV_VERSION)
set(multiValueArgs SOURCES)
cmake_parse_arguments(_spirvshaders "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
foreach(GLSL ${ARGN})
if(NOT _spirvshaders_SPIRV_VERSION)
set(_spirvshaders_SPIRV_VERSION 1.0)
endif()
foreach(GLSL ${_spirvshaders_SOURCES})
string(MAKE_C_IDENTIFIER ${GLSL} IDENTIFIER)
spirv_shader(HEADER ${GLSL} ${IDENTIFIER})
set(HEADER "${CMAKE_CURRENT_BINARY_DIR}/${GLSL}.h")
set(GLSL "${CMAKE_CURRENT_SOURCE_DIR}/${GLSL}")
add_custom_command(
OUTPUT ${HEADER}
COMMAND ${GLSLANGVALIDATOR_COMMAND} -V --target-env spirv${_spirvshaders_SPIRV_VERSION} ${GLSL} --vn ${IDENTIFIER} -o ${HEADER}
DEPENDS ${GLSL})
list(APPEND HEADERS ${HEADER})
endforeach()

View file

@ -0,0 +1,7 @@
{
"file_format_version": "1.0.0",
"runtime": {
"name": "Monado",
"library_path": "@target_path@"
}
}

View file

@ -0,0 +1,3 @@
Copyright 2018-2023, Collabora, Ltd.
SPDX-License-Identifier: BSL-1.0

View file

@ -33,6 +33,8 @@ set(FLAG_CANDIDATES
# Older deprecated flag for ASan
"-g -faddress-sanitizer"
"/fsanitize=address"
)

View file

@ -48,7 +48,7 @@ SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Monado contributors
length, normalize if not within float epsilon.
([!659](https://gitlab.freedesktop.org/monado/monado/merge_requests/659))
- Drivers
- North Star: Fix memory leak in math code.
- ns: Fix memory leak in math code.
([!564](https://gitlab.freedesktop.org/monado/monado/merge_requests/564))
- psvr: Rename some variables for better readability.
([!597](https://gitlab.freedesktop.org/monado/monado/merge_requests/597))
@ -177,7 +177,7 @@ SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Monado contributors
now a per layer thing.
([!461](https://gitlab.freedesktop.org/monado/monado/merge_requests/461))
- Add `xrt_compositor_info` struct that allows the compositor carry information
to about it's capbilities and it's recommended values. Not everything is hooked
to about its capabilities and its recommended values. Not everything is hooked
up at the moment.
([!461](https://gitlab.freedesktop.org/monado/monado/merge_requests/461))
- Add defines for underlying handle types.
@ -218,7 +218,7 @@ SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Monado contributors
- Remove the `out_timestamp` argument to the `xrt_device::get_tracked_pose`
function, it's not needed anymore and the devices can do prediction better
as
it knows more about it's tracking system the the state tracker.
it knows more about its tracking system the the state tracker.
([!521](https://gitlab.freedesktop.org/monado/monado/merge_requests/521))
- Replace mesh generator with `compute_distortion` function on `xrt_device`. This
is used to both make it possible to use mesh shaders for devices and to provide
@ -439,7 +439,7 @@ SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Monado contributors
- Major changes
- Centralise the logging functionality in Monado to a single util helper.
Previously most of our logging was done via fprints and gated behind booleans,
now there are common functions to call and a predfined set of levels.
now there are common functions to call and a predefined set of levels.
([!408](https://gitlab.freedesktop.org/monado/monado/merge_requests/408),
[!409](https://gitlab.freedesktop.org/monado/monado/merge_requests/409))
- XRT Interface
@ -566,12 +566,12 @@ SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Monado contributors
- comp: Set a compositor window title.
([!418](https://gitlab.freedesktop.org/monado/monado/merge_requests/418))
- IPC
- server: Almost completely overhaul the handling of swapchain life cycle
- server: Almost completely overhaul the handling of swapchain lifecycle
including: correctly track which swapchains are alive; reuse ids; enforce the
maximum number of swapchains; and destroy underlying swapchains when they are
destroyed by the client.
([!359](https://gitlab.freedesktop.org/monado/monado/merge_requests/359))
- util: Make sure to not access NULL control messages, say in the case of the
- util: Make sure to not dereference NULL control messages, say in the case of the
server failing to create a swapchain. Also add a whole bunch of paranoia when
it comes to the alignment of the control message buffers.
([!359](https://gitlab.freedesktop.org/monado/monado/merge_requests/359))
@ -587,7 +587,7 @@ SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Monado contributors
copies the FDs to the client.
([!359](https://gitlab.freedesktop.org/monado/monado/merge_requests/359))
- client: When we give a image fd to the either OpenGL or Vulkan it is consumed
and can not be rused. So make sure that it is set to an invalid fd value on the
and cannot be reused. So make sure that it is set to an invalid fd value on the
`xrt_image_fd` on the owning `xrt_swapchain_fd`.
([!359](https://gitlab.freedesktop.org/monado/monado/merge_requests/359))
- main: We were alpha blending all layers previously, but now we support the

View file

@ -1,11 +1,25 @@
# Copyright 2018-2020, Collabora, Ltd.
# Copyright 2018-2022, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
# check if Doxygen is installed
find_package(Doxygen)
cmake_dependent_option(BUILD_DOC "Build documentation" ON "DOXYGEN_FOUND" OFF)
cmake_dependent_option(BUILD_DOC_WARN_UNDOCUMENTED "Warn on undocumented entities when building documentation" OFF "DOXYGEN_FOUND" OFF)
cmake_dependent_option(BUILD_DOC_EXTRACT_ALL "Extract all entities for documentation, not just documented ones (conflicts with BUILD_DOC_WARN_UNDOCUMENTED)" ON "DOXYGEN_FOUND AND NOT BUILD_DOC_WARN_UNDOCUMENTED" OFF)
option_with_deps(
BUILD_DOC "Build documentation"
DEFAULT OFF
DEPENDS DOXYGEN_FOUND
)
option_with_deps(
BUILD_DOC_WARN_UNDOCUMENTED "Warn on undocumented entities when building documentation"
DEFAULT OFF
DEPENDS DOXYGEN_FOUND
)
option_with_deps(
BUILD_DOC_EXTRACT_ALL
"Extract all entities for documentation, not only documented ones (conflicts with BUILD_DOC_WARN_UNDOCUMENTED)"
DEFAULT OFF
DEPENDS DOXYGEN_FOUND "NOT BUILD_DOC_WARN_UNDOCUMENTED"
)
if(BUILD_DOC)
if(BUILD_DOC_WARN_UNDOCUMENTED)
@ -29,16 +43,27 @@ if(BUILD_DOC)
# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
# copy the schema
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json
${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json
@ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json.license
${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json.license
@ONLY)
# copy the schemas
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json
${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json @ONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json.license
${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json.license @ONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/example_configs/calibration_v2.schema.json
${CMAKE_CURRENT_BINARY_DIR}/html/calibration_v2.schema.json @ONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/example_configs/calibration_v2.schema.json.license
${CMAKE_CURRENT_BINARY_DIR}/html/calibration_v2.schema.json.license @ONLY
)
# note the option ALL which allows to build the docs together with the application
add_custom_target(doc_doxygen ALL
add_custom_target(
doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"

View file

@ -36,7 +36,7 @@ PREDEFINED = VK_USE_PLATFORM_XCB_KHR \
XR_USE_GRAPHICS_API_VULKAN \
XR_USE_PLATFORM_XLIB \
XR_USE_TIMESPEC \
XRT_BUILD_DRIVER_RS \
XRT_BUILD_DRIVER_REALSENSE \
XRT_DOXYGEN \
XRT_FEATURE_SERVICE \
XRT_HAVE_JPEG \
@ -61,11 +61,13 @@ REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
ALWAYS_DETAILED_SEC = YES
# Our common headers are too popular
INCLUDED_BY_GRAPH = NO
WARN_IF_UNDOCUMENTED = @DOXYGEN_WARN_UNDOCUMENTED@
EXTRACT_ALL = @DOXYGEN_EXTRACT_ALL@
HIDE_UNDOC_RELATIONS = NO
EXTRACT_STATIC = @DOXYGEN_EXTRACT_ALL@
EXTRACT_STATIC = YES
MACRO_EXPANSION = YES
@ -91,3 +93,19 @@ BUILTIN_STL_SUPPORT = YES
CASE_SENSE_NAMES = NO
GENERATE_LATEX = NO
USE_MATHJAX = YES
# Doxygen Awesome theme settings
GENERATE_TREEVIEW = YES # required!
DISABLE_INDEX = NO
FULL_SIDEBAR = NO
HTML_COLORSTYLE = LIGHT # required with Doxygen >= 1.9.5
HTML_HEADER = @SRCDIR@/doc/header.html
HTML_EXTRA_STYLESHEET = @SRCDIR@/doc/doxygen-awesome-css/doxygen-awesome.css \
HTML_EXTRA_FILES = @SRCDIR@/doc/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js \
@SRCDIR@/doc/doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js \
@SRCDIR@/doc/doxygen-awesome-css/doxygen-awesome-paragraph-link.js \
@SRCDIR@/doc/doxygen-awesome-css/doxygen-custom/toggle-alternative-theme.js \
@SRCDIR@/doc/doxygen-awesome-css/doxygen-awesome-interactive-toc.js \
@SRCDIR@/doc/doxygen-awesome-css/doxygen-awesome-tabs.js

View file

@ -1,6 +1,6 @@
{
"$schema": "https://ryanpavlik.gitlab.io/proclamation/proclamation.schema.json",
"#": "This is a config file for Proclamation, the changelog combiner: https://gitlab.com/ryanpavlik/proclamation",
"$schema": "https://proclamation.gitlab.io/proclamation/proclamation.schema.json",
"#": "This is a config file for Proclamation, the changelog combiner: https://gitlab.com/proclamation/proclamation",
"SPDX-License-Identifier: CC0-1.0": "",
"SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors": "",
"project_name": "Monado",
@ -27,10 +27,16 @@
"Compositor": {
"directory": "compositor"
},
"Tracking": {
"directory": "tracking"
},
"Helper Libraries": {
"directory": "auxiliary",
"sort_by_prefix": true
},
"Documentation": {
"directory": "doc"
},
"Misc. Features": {
"directory": "misc_features"
},

View file

@ -15,7 +15,7 @@ fragment for the changelog describing their change. See below for more details.
- Config file: default name (`.proclamation.json`)
- Location of the per-changelog-section directories: `doc/changes`
[Proclamation]: https://gitlab.com/ryanpavlik/proclamation
[Proclamation]: https://gitlab.com/proclamation/proclamation
## Table of Contents
@ -55,14 +55,12 @@ Each change should add a changelog fragment file, whose contents are
Markdown-formatted text describing the change briefly. Reference metadata will
be used to automatically add links to associated issues/merge requests/pull
requests, so no need to add these in your fragment text. The simplest changelog
fragment just contains one line of Markdown text describing the change:
fragment contains one line of Markdown text describing the change:
```md
Here the author of a change has written some text about it.
```
(If you change the template in your Proclamation config file, your project can use a different markup format than Markdown.)
### References
The changelog fragment system revolves around "references" - these are issue
@ -95,7 +93,7 @@ extension added. (You can also use `.rst` or `.txt` as your extension in your
project.)
To specify additional references in a file, prefix the contents of the changelog
fragment with a block delimited above and below by `---`, with one reference on
fragment with a block delimited before and after by `---`, with one reference on
each line. (This can be seen as a very minimal subset of "YAML Front Matter", if
you're familiar with that concept.) For example:
@ -109,7 +107,7 @@ Here the author of a change has written some text about it.
There are provisions for providing your own reference parser if this format is
entirely unusable, but they're underdeveloped. (Most use cases found by the
original author can actually be accommodated just by changing the template and
original author can actually be accommodated by changing the template and
specifying `.`-delimited fields in references.) If this functionality is
interesting to you, get involved in the development of Proclamation and help
finish it!
@ -166,7 +164,7 @@ elaborate use-cases than this.)
- `insert_point_pattern` - Useful mainly if you're not using the default
template. The first match of this regex will be considered the first line of
a release entry, and your new release will be put in your changelog file
above it. Default works with the default template (looks for a second-level
before it. Default works with the default template (looks for a second-level
Markdown heading).
- `extra_data` - Any extra data you'd like to pass along to your custom
template.

View file

@ -0,0 +1 @@
t/file: Migrate calibration file format to JSON.

View file

@ -0,0 +1,2 @@
t/slam: Update SLAM interface to support dynamically query external systems for
special features.

View file

@ -0,0 +1 @@
t/euroc: Add EuRoC dataset recorder for saving camera and IMU streams to disk.

View file

@ -0,0 +1 @@
t/slam: Add naive prediction to the SLAM tracker.

View file

@ -0,0 +1 @@
t/slam: Add trajectory filters and use IMU for prediction in the SLAM tracker.

View file

@ -0,0 +1 @@
u/config_json: Add functionality to save/load gui state to file.

View file

@ -0,0 +1,7 @@
---
- mr.1081
- mr.1104
---
u/pacing: Renames and improvements for frame pacing (formerly known as render
and display timing) code and APIs.

View file

@ -0,0 +1,3 @@
vk: Refactor and rename various function related to compositor swapchain
images and their flags, these changes makes it clear it's only used for these
images and image views.

View file

@ -0,0 +1 @@
vk: Check which fence types can be imported and exported on the device.

View file

@ -0,0 +1 @@
vk: Add functions to create, submit and then export a fence native handle.

Some files were not shown because too many files have changed in this diff Show more