Skip to content

Commit

Permalink
🔧 Use system OpenSSL on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherFoxGuy committed Sep 27, 2024
1 parent a9190fc commit e7e0529
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
44 changes: 44 additions & 0 deletions conan-recipes/openssl/system/conanfile.py
Original file line number Diff line number Diff line change
@@ -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")

5 changes: 3 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ def requirements(self):
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@overte/stable", force=True)

if self.settings.os == "Windows":
self.requires("neuron/12.2@overte/prebuild")
Expand Down

0 comments on commit e7e0529

Please sign in to comment.