mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-06 01:03:19 +02:00
🐛 Fixed OpenVR failing to link on windows
This commit is contained in:
parent
f1b1e7f50c
commit
657db4c8fe
4 changed files with 40 additions and 7 deletions
|
@ -1,4 +1,10 @@
|
|||
sources:
|
||||
"1.26.7":
|
||||
url: https://github.com/ValveSoftware/openvr/archive/refs/tags/v1.26.7.tar.gz
|
||||
1.26.7:
|
||||
sha256: e7391f1129db777b2754f5b017cfa356d7811a7bcaf57f09805b47c2e630a725
|
||||
url: https://github.com/ValveSoftware/openvr/archive/refs/tags/v1.26.7.tar.gz
|
||||
2.0.10:
|
||||
sha256: 22c9a3c5c2ed9ebf0423ab329ecc3b870b0c980abdfbaaa204e5b59313d8c7e3
|
||||
url: https://github.com/ValveSoftware/openvr/archive/refs/tags/v2.0.10.tar.gz
|
||||
2.2.3:
|
||||
sha256: 4da20c2c33e7488703802eafd7f2e6c92dd0f324e887711e1e11e9b9d3dd3daa
|
||||
url: https://github.com/ValveSoftware/openvr/archive/refs/tags/v2.2.3.tar.gz
|
||||
|
|
|
@ -16,21 +16,40 @@ class OpenvrConan(ConanFile):
|
|||
homepage = "https://github.com/ValveSoftware/openvr"
|
||||
license = "BSD-3-Clause"
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
implements = ["auto_shared_fpic"]
|
||||
options = {"shared": [True, False], "fPIC": [True, False]}
|
||||
default_options = {"shared": False, "fPIC": True}
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
def requirements(self):
|
||||
self.requires("jsoncpp/1.9.4")
|
||||
self.requires("jsoncpp/1.9.5")
|
||||
|
||||
def source(self):
|
||||
get(self, **self.conan_data["sources"][self.version], strip_root=True)
|
||||
# Unvendor jsoncpp (we rely on our CMake wrapper for jsoncpp injection)
|
||||
replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "jsoncpp.cpp", "")
|
||||
rmdir(self, os.path.join(self.source_folder, "src", "json"))
|
||||
replace_in_file(
|
||||
self,
|
||||
os.path.join(self.source_folder, "src", "CMakeLists.txt"),
|
||||
"jsoncpp.cpp",
|
||||
"",
|
||||
)
|
||||
replace_in_file(
|
||||
self,
|
||||
os.path.join(self.source_folder, "src", "CMakeLists.txt"),
|
||||
"target_link_libraries(${LIBNAME} ${EXTRA_LIBS} ${CMAKE_DL_LIBS})",
|
||||
"""
|
||||
find_package(jsoncpp)
|
||||
target_link_libraries(${LIBNAME} JsonCpp::JsonCpp ${EXTRA_LIBS} ${CMAKE_DL_LIBS})
|
||||
""",
|
||||
)
|
||||
|
||||
def generate(self):
|
||||
tc = CMakeToolchain(self)
|
||||
tc.variables["BUILD_UNIVERSAL"] = "OFF"
|
||||
tc.variables["BUILD_SHARED"] = self.options.shared
|
||||
tc.variables["USE_LIBCXX"] = "OFF"
|
||||
tc.generate()
|
||||
deps = CMakeDeps(self)
|
||||
|
@ -45,9 +64,17 @@ class OpenvrConan(ConanFile):
|
|||
copy(self, "LICENSE", src=self.source_folder, dst="licenses")
|
||||
cmake = CMake(self)
|
||||
cmake.install()
|
||||
copy(self, pattern="openvr_api*.dll", dst="bin", src=os.path.join(self.source_folder, "bin"), keep_path=False)
|
||||
copy(
|
||||
self,
|
||||
pattern="*.dll",
|
||||
dst="bin",
|
||||
src=os.path.join(self.build_folder, "bin", "win64"),
|
||||
keep_path=False,
|
||||
)
|
||||
|
||||
def package_info(self):
|
||||
if not self.options.shared:
|
||||
self.cpp_info.defines = ["OPENVR_BUILD_STATIC"]
|
||||
self.cpp_info.names["pkg_config"] = "openvr"
|
||||
self.cpp_info.libs = collect_libs(self)
|
||||
self.cpp_info.includedirs.append(os.path.join("include", "openvr"))
|
||||
|
|
|
@ -54,7 +54,7 @@ class Overte(ConanFile):
|
|||
self.requires("nvidia-texture-tools/2023.01@overte/stable")
|
||||
self.requires("openexr/3.1.9")
|
||||
self.requires("openssl/1.1.1w")
|
||||
self.requires("openvr/1.26.7@overte/stable")
|
||||
self.requires("openvr/2.2.3@overte/stable")
|
||||
self.requires("opus/1.4")
|
||||
self.requires("polyvox/0.2.1@overte/stable")
|
||||
self.requires("quazip/1.4@overte/stable")
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "OpenVrHelpers.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#define VIVE_PRO_EYE
|
||||
// #define VIVE_PRO_EYE
|
||||
#endif
|
||||
|
||||
using PuckPosePair = std::pair<uint32_t, controller::Pose>;
|
||||
|
|
Loading…
Reference in a new issue