From 3b5057529e02931998389efc4d7965711ee2c576 Mon Sep 17 00:00:00 2001 From: Edgar Date: Fri, 27 Sep 2024 13:02:41 +0200 Subject: [PATCH] :wrench: Use system OpenSSL on Linux --- conan-recipes/openssl/system/conanfile.py | 44 +++++++++++++++++++++++ conanfile.py | 5 +-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 conan-recipes/openssl/system/conanfile.py diff --git a/conan-recipes/openssl/system/conanfile.py b/conan-recipes/openssl/system/conanfile.py new file mode 100644 index 0000000000..f0e4ad1fd4 --- /dev/null +++ b/conan-recipes/openssl/system/conanfile.py @@ -0,0 +1,44 @@ +from conan import ConanFile +from conan.tools.system import package_manager +from conan.tools.gnu import PkgConfig + + +class SysConfigOpenSSLConan(ConanFile): + name = "openssl" + version = "system" + description = "cross-platform virtual conan package for the OpenSSL support" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def package_id(self): + self.info.clear() + + def system_requirements(self): + apt = package_manager.Apt(self) + apt.install(["libssl-dev"], check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["openssl"], check=True) + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "openssl_system" + self.cpp_info.filenames["cmake_find_package_multi"] = "openssl_system" + + self.cpp_info.set_property("cmake_file_name", "openssl_system") + + self.cpp_info.bindirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os == "Macos": + self.cpp_info.frameworks.append("libssl") + self.cpp_info.frameworks.append("libcrypto") + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["libssl", "libcrypto"] + elif self.settings.os in ["Linux", "FreeBSD"]: + pkg_config = PkgConfig(self, 'openssl') + pkg_config.fill_cpp_info(self.cpp_info, is_system=self.settings.os != "FreeBSD") + diff --git a/conanfile.py b/conanfile.py index cd33488fdd..aa1f8102a4 100644 --- a/conanfile.py +++ b/conanfile.py @@ -73,9 +73,10 @@ class Overte(ConanFile): self.requires("v-hacd/4.1.0") self.requires("vulkan-memory-allocator/3.0.1") self.requires("zlib/1.2.13") - self.requires("glm/0.9.9.5", force=True) - self.requires("openssl/3.2.1", force=True) + + if self.settings.os == "Linux": + self.requires("openssl/system@anotherfoxguy/stable", force=True) if self.settings.os == "Windows": self.requires("neuron/12.2@overte/prebuild")