From 334864de7fc0de7bedcea745eca1f20a04de3ac9 Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Thu, 17 Dec 2020 16:14:44 +0100 Subject: [PATCH] build/meson: Generate SteamVR input profiles --- src/xrt/auxiliary/meson.build | 2 ++ src/xrt/targets/steamvr_drv/meson.build | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/xrt/auxiliary/meson.build b/src/xrt/auxiliary/meson.build index f79fe5fc7..b93491541 100644 --- a/src/xrt/auxiliary/meson.build +++ b/src/xrt/auxiliary/meson.build @@ -13,6 +13,8 @@ u_git_tag_c = vcs_tag( # Binding generation # +aux_bindings_dir = join_paths(meson.current_source_dir(), 'bindings') + prog_python = import('python').find_installation('python3') generated_bindings = custom_target('bindings code', diff --git a/src/xrt/targets/steamvr_drv/meson.build b/src/xrt/targets/steamvr_drv/meson.build index 23c9d39f3..2ee706c1a 100644 --- a/src/xrt/targets/steamvr_drv/meson.build +++ b/src/xrt/targets/steamvr_drv/meson.build @@ -30,12 +30,15 @@ else endif plugin_dir = join_paths(build_root, 'steamvr-monado') + +bindings_json_path = join_paths(aux_bindings_dir, 'bindings.json') resources_dir = join_paths(plugin_dir, 'resources') +input_profile_dir = join_paths(resources_dir, 'input') driver_manifest_path = join_paths(plugin_dir, 'driver.vrdrivermanifest') copy_asset = find_program('copy_assets.py') copy_plugin = find_program('copy_plugin.py') - +generate_profiles = find_program(join_paths(aux_bindings_dir, 'steamvr_profiles.py')) fake_driver_manifest = custom_target( 'driver_manifest_copy', @@ -49,12 +52,20 @@ fake_driver_manifest = custom_target( fake_driver_resources = custom_target( 'driver_resources_copy', depends : driver_monado, - input : 'resources', + input : 'resources', # https://github.com/mesonbuild/meson/issues/4717 output : 'fake_driver_resources', command : [copy_asset, 'DIRECTORY', '@INPUT@', resources_dir], build_by_default : true ) +custom_target( + 'driver_input_profiles_generate', + depends : driver_monado, + input : bindings_json_path, + output : 'fake_input_profiles_generate', + command : [generate_profiles, '@INPUT@', input_profile_dir], + build_by_default : true +) plugin_archdir = ''