build: Use openvr_api as subproject

This commit is contained in:
Joshua Ashton 2023-01-11 20:26:00 +00:00 committed by Joshie
parent 33f1103155
commit 8b01fbefd9
3 changed files with 16 additions and 12 deletions

View file

@ -17,7 +17,7 @@ jobs:
pacman -S --noconfirm git meson clang glslang libcap wlroots \ pacman -S --noconfirm git meson clang glslang libcap wlroots \
sdl2 vulkan-headers libx11 libxcomposite libxrender libxres \ sdl2 vulkan-headers libx11 libxcomposite libxrender libxres \
libxtst libxkbcommon libdrm libinput wayland-protocols \ libxtst libxkbcommon libdrm libinput wayland-protocols \
xorg-xwayland pipewire xorg-xwayland pipewire cmake
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive

View file

@ -35,20 +35,24 @@ hwdata_dep = dependency('hwdata')
dep_x11 = dependency('x11') dep_x11 = dependency('x11')
vulkan_dep = dependency('vulkan') vulkan_dep = dependency('vulkan')
cpu_family = target_machine.cpu_family() if get_option('enable_openvr_support')
openvr_path_base = meson.source_root() + '/subprojects/openvr' openvr_dep = dependency('openvr_api', required : false)
openvr_lib_path_base = openvr_path_base + '/lib' if not openvr_dep.found()
if (cpu_family == 'x86_64') cmake = import('cmake')
openvr_lib_path = openvr_lib_path_base +'/linux64' openvr_var = cmake.subproject_options()
elif (cpu_family == 'x86') openvr_var.add_cmake_defines({'USE_LIBCXX': false})
openvr_lib_path = openvr_lib_path_base +'/linux32' openvr_var.set_override_option('warning_level', '0')
elif (cpu_family == 'aarch64') openvr_proj = cmake.subproject('openvr', options : openvr_var)
openvr_lib_path = openvr_lib_path_base +'/linuxarm64' openvr_dep = openvr_proj.dependency('openvr_api')
endif
else
# null dep
openvr_dep = dependency('', required : false)
endif endif
openvr_dep = cppc.find_library('openvr_api', dirs: openvr_lib_path, required : get_option('openvr'))
add_project_arguments( add_project_arguments(
'-DHAVE_PIPEWIRE=@0@'.format(pipewire_dep.found().to_int()), '-DHAVE_PIPEWIRE=@0@'.format(pipewire_dep.found().to_int()),
'-DHAVE_OPENVR=@0@'.format(openvr_dep.found().to_int()),
'-DHWDATA_PNP_IDS="@0@"'.format(hwdata_dep.get_variable('pkgdatadir') / 'pnp.ids'), '-DHWDATA_PNP_IDS="@0@"'.format(hwdata_dep.get_variable('pkgdatadir') / 'pnp.ids'),
language: 'cpp', language: 'cpp',
) )

View file

@ -1,4 +1,4 @@
option('pipewire', type: 'feature', description: 'Screen capture via PipeWire') option('pipewire', type: 'feature', description: 'Screen capture via PipeWire')
option('enable_gamescope', type : 'boolean', value : true, description: 'Build Gamescope executable') option('enable_gamescope', type : 'boolean', value : true, description: 'Build Gamescope executable')
option('enable_gamescope_wsi_layer', type : 'boolean', value : true, description: 'Build Gamescope layer') option('enable_gamescope_wsi_layer', type : 'boolean', value : true, description: 'Build Gamescope layer')
option('openvr', type : 'feature', description: 'SteamVR Integrations') option('enable_openvr_support', type : 'boolean', value : true, description: 'OpenVR Integrations')