inc/xrt: Add Android config header to store package name.

This commit is contained in:
Ryan Pavlik 2020-09-08 14:11:49 -05:00
parent b90dc8fdea
commit 0f43bbe924
3 changed files with 29 additions and 0 deletions

View file

@ -178,6 +178,17 @@ cmake_dependent_option(XRT_BUILD_DRIVER_SURVIVE "Enable libsurvive driver" OFF "
# All drivers must be listed in here to be included in the generated header!
list(APPEND AVAILABLE_DRIVERS ARDUINO DUMMY HDK HYDRA NS OHMD PSMV PSVR RS V4L2 VIVE DAYDREAM REMOTE SURVIVE)
# 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)
if(XRT_FEATURE_SERVICE)
set(XRT_ANDROID_PACKAGE "org.freedesktop.monado.openxr_runtime.out_of_process")
else()
set(XRT_ANDROID_PACKAGE "org.freedesktop.monado.openxr_runtime.in_process")
endif()
endif()
###
# Flags
###

View file

@ -30,3 +30,9 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_vulkan.h
@ONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_android.h.cmake_in
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_android.h
@ONLY
)

View file

@ -0,0 +1,12 @@
// Copyright 2020, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Android defines.
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
* @ingroup xrt_iface
*/
#pragma once
#cmakedefine XRT_ANDROID_PACKAGE "@XRT_ANDROID_PACKAGE@"