build: Use openvr_api as subproject
This commit is contained in:
parent
33f1103155
commit
8b01fbefd9
3 changed files with 16 additions and 12 deletions
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
@ -17,7 +17,7 @@ jobs:
|
|||
pacman -S --noconfirm git meson clang glslang libcap wlroots \
|
||||
sdl2 vulkan-headers libx11 libxcomposite libxrender libxres \
|
||||
libxtst libxkbcommon libdrm libinput wayland-protocols \
|
||||
xorg-xwayland pipewire
|
||||
xorg-xwayland pipewire cmake
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
|
24
meson.build
24
meson.build
|
@ -35,20 +35,24 @@ hwdata_dep = dependency('hwdata')
|
|||
dep_x11 = dependency('x11')
|
||||
vulkan_dep = dependency('vulkan')
|
||||
|
||||
cpu_family = target_machine.cpu_family()
|
||||
openvr_path_base = meson.source_root() + '/subprojects/openvr'
|
||||
openvr_lib_path_base = openvr_path_base + '/lib'
|
||||
if (cpu_family == 'x86_64')
|
||||
openvr_lib_path = openvr_lib_path_base +'/linux64'
|
||||
elif (cpu_family == 'x86')
|
||||
openvr_lib_path = openvr_lib_path_base +'/linux32'
|
||||
elif (cpu_family == 'aarch64')
|
||||
openvr_lib_path = openvr_lib_path_base +'/linuxarm64'
|
||||
if get_option('enable_openvr_support')
|
||||
openvr_dep = dependency('openvr_api', required : false)
|
||||
if not openvr_dep.found()
|
||||
cmake = import('cmake')
|
||||
openvr_var = cmake.subproject_options()
|
||||
openvr_var.add_cmake_defines({'USE_LIBCXX': false})
|
||||
openvr_var.set_override_option('warning_level', '0')
|
||||
openvr_proj = cmake.subproject('openvr', options : openvr_var)
|
||||
openvr_dep = openvr_proj.dependency('openvr_api')
|
||||
endif
|
||||
else
|
||||
# null dep
|
||||
openvr_dep = dependency('', required : false)
|
||||
endif
|
||||
openvr_dep = cppc.find_library('openvr_api', dirs: openvr_lib_path, required : get_option('openvr'))
|
||||
|
||||
add_project_arguments(
|
||||
'-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'),
|
||||
language: 'cpp',
|
||||
)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
option('pipewire', type: 'feature', description: 'Screen capture via PipeWire')
|
||||
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('openvr', type : 'feature', description: 'SteamVR Integrations')
|
||||
option('enable_openvr_support', type : 'boolean', value : true, description: 'OpenVR Integrations')
|
||||
|
|
Loading…
Reference in a new issue