2019-09-24 13:43:43 +00:00
|
|
|
# Copyright 2019, Collabora, Ltd.
|
|
|
|
# SPDX-License-Identifier: BSL-1.0
|
|
|
|
|
|
|
|
######
|
|
|
|
# Create a loadable OpenXR driver.
|
|
|
|
|
|
|
|
# runtime_bare_suffix = 'xrt'
|
|
|
|
# runtime_prefix = runtime_bare_prefix + '_'
|
|
|
|
runtime_prefix = ''
|
|
|
|
|
|
|
|
runtime_bare_suffix = 'monado'
|
|
|
|
runtime_suffix = '_' + runtime_bare_suffix
|
|
|
|
|
|
|
|
runtime_target = '@0@openxr@1@'.format(runtime_prefix, runtime_suffix)
|
|
|
|
|
|
|
|
# OpenXR 1.0
|
|
|
|
xr_api_major = 1
|
|
|
|
|
2019-10-10 14:36:05 +00:00
|
|
|
hack_deps = []
|
|
|
|
hack_src = []
|
|
|
|
hack_libs = []
|
|
|
|
hack_incs = []
|
|
|
|
|
|
|
|
if sdl2.found()
|
|
|
|
hack_deps += sdl2
|
|
|
|
hack_src += [
|
|
|
|
'oxr_sdl2_hack.c',
|
2019-10-22 20:37:03 +00:00
|
|
|
'../../../external/imgui/cimgui_sdl.cpp',
|
2019-10-10 14:36:05 +00:00
|
|
|
'../../../external/imgui/imgui_impl_sdl.cpp',
|
|
|
|
'../../../external/imgui/imgui_impl_sdl.h',
|
|
|
|
]
|
|
|
|
hack_libs += lib_st_gui
|
|
|
|
hack_incs += [
|
|
|
|
st_include,
|
|
|
|
]
|
|
|
|
else
|
|
|
|
hack_src += 'oxr_sdl2_hack.c'
|
|
|
|
endif
|
|
|
|
|
2020-01-14 18:21:23 +00:00
|
|
|
openxr_deps = [
|
|
|
|
libusb,
|
|
|
|
libuvc,
|
|
|
|
pthreads,
|
|
|
|
targets_enabled,
|
|
|
|
udev,
|
|
|
|
vulkan,
|
|
|
|
]
|
|
|
|
|
|
|
|
if build_opengl
|
|
|
|
openxr_deps += [opengl]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if build_opengl and build_xlib
|
|
|
|
openxr_deps += [x11]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if build_xcb
|
|
|
|
openxr_deps += [xcb]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if build_xcb_xrandr_direct
|
|
|
|
openxr_deps += [xcb_randr]
|
|
|
|
endif
|
|
|
|
|
2019-09-24 13:43:43 +00:00
|
|
|
openxr = library(
|
|
|
|
runtime_target,
|
2019-10-10 14:36:05 +00:00
|
|
|
files(
|
|
|
|
'target.c',
|
|
|
|
hack_src,
|
|
|
|
),
|
2019-09-24 13:43:43 +00:00
|
|
|
link_whole: [
|
2020-02-23 12:30:26 +00:00
|
|
|
lib_aux_vk,
|
2019-09-24 13:43:43 +00:00
|
|
|
lib_aux_os,
|
2019-10-09 15:39:38 +00:00
|
|
|
lib_aux_ogl,
|
2019-09-24 13:43:43 +00:00
|
|
|
lib_aux_util,
|
|
|
|
lib_aux_math,
|
|
|
|
lib_comp,
|
|
|
|
lib_st_oxr,
|
|
|
|
lib_st_prober,
|
|
|
|
lib_target_lists,
|
2019-10-10 14:36:05 +00:00
|
|
|
] + driver_libs + hack_libs,
|
2019-09-24 13:43:43 +00:00
|
|
|
include_directories: [
|
2019-10-10 14:36:05 +00:00
|
|
|
external_include,
|
|
|
|
st_include, # Sigh debian meson requires this.
|
2019-09-24 13:43:43 +00:00
|
|
|
aux_include,
|
|
|
|
common_include,
|
|
|
|
drv_include,
|
|
|
|
xrt_include,
|
2019-10-10 14:36:05 +00:00
|
|
|
] + hack_incs,
|
2020-01-14 18:21:23 +00:00
|
|
|
dependencies: openxr_deps + driver_deps + hack_deps,
|
2019-09-24 13:43:43 +00:00
|
|
|
install: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
manifest_in = files('openxr_monado.meson.in.json')
|
|
|
|
|
|
|
|
manifest_conf = configuration_data()
|
|
|
|
# https://github.com/mesonbuild/meson/issues/5941
|
|
|
|
sopath = join_paths(get_option('prefix'),
|
|
|
|
get_option('libdir'), 'libopenxr_monado.so')
|
|
|
|
manifest_conf.set('runtime_path', sopath)
|
|
|
|
|
|
|
|
manifest_path = join_paths(
|
|
|
|
get_option('prefix'), get_option('datadir'), xr_api_major.to_string())
|
|
|
|
|
2019-09-28 13:23:12 +00:00
|
|
|
manifest_json = configure_file(
|
|
|
|
input: manifest_in,
|
|
|
|
output: 'openxr_monado.json',
|
|
|
|
configuration: manifest_conf,
|
|
|
|
install_dir: manifest_path,
|
|
|
|
)
|
2019-09-24 13:43:43 +00:00
|
|
|
|
|
|
|
meson.add_install_script('install_active_runtime.sh', get_option('sysconfdir'),
|
|
|
|
join_paths(manifest_path, runtime_target + '.json'), xr_api_major.to_string())
|