Explicit full path for OpenComposite search

This commit is contained in:
Patrick Nicolas
2024-11-30 17:15:07 +01:00
parent 2cca89bd6e
commit cf55ff9b3a
2 changed files with 4 additions and 4 deletions
+2 -1
View File
@@ -39,7 +39,8 @@ auto_option(WIVRN_USE_X264 "Enable x264 software encoder" AUTO)
auto_option(WIVRN_USE_PIPEWIRE "Enable pipewire backend" AUTO)
auto_option(WIVRN_USE_PULSEAUDIO "Enable pulseaudio backend" AUTO)
set(OPENCOMPOSITE_SEARCH_PATH "/usr/local/lib:/usr/lib:/opt" CACHE STRING "List of places to search for OpenComposite, separated by :")
set(OPENCOMPOSITE_SEARCH_PATH "/usr/local/lib/OpenComposite:/usr/lib/OpenComposite:/opt/OpenComposite"
CACHE STRING "List of places to search for OpenComposite, separated by :")
option(WIVRN_FEATURE_RENDERDOC "Support renderdoc" OFF)
option(WIVRN_FEATURE_SOLARXR "Enable SolarXR driver" OFF)
+2 -3
View File
@@ -48,12 +48,11 @@ std::filesystem::path active_runtime::manifest_path()
std::filesystem::path active_runtime::opencomposite_path()
{
std::filesystem::path OpenComposite = "OpenComposite";
if (auto path = flatpak_key(flatpak::section::instance, "app-path"))
return *path / OpenComposite;
return std::filesystem::path(*path) / "OpenComposite";
for (auto path: std::ranges::split_view(std::string_view(OPENCOMPOSITE_SEARCH_PATH), std::string_view(":")))
{
if (auto res = std::string_view(path) / OpenComposite; std::filesystem::exists(res))
if (auto res = std::string_view(path); std::filesystem::exists(res))
return res;
}
return {};