From 2762d1bd223ab6aca250a597fb80c6e9492a9ecf Mon Sep 17 00:00:00 2001 From: Oleg Yukhnevich Date: Fri, 29 Dec 2023 22:25:16 +0200 Subject: [PATCH] refactor conanfile: * include `openssl` only (ignore zlib) * get headers only from `static` build * include only `libcrypto` and `libssl` (ignore fips/legacy providers) --- packages/openssl3/conanfile.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/openssl3/conanfile.py b/packages/openssl3/conanfile.py index 1e51d55..a7d33af 100644 --- a/packages/openssl3/conanfile.py +++ b/packages/openssl3/conanfile.py @@ -5,17 +5,26 @@ class Openssl3Conan(ConanFile): + options = { + "shared": [True, False], + } + def requirements(self): self.requires("openssl/" + str(self.version)) def generate(self): - for dep in [self.dependencies["openssl"], self.dependencies["zlib"]]: - includedir = dep.cpp_info.includedirs[0] - libdir = dep.cpp_info.libdirs[0] + libs = ["libcrypto", "libssl"] + dep = self.dependencies["openssl"] + includedir = dep.cpp_info.includedirs[0] + libdir = dep.cpp_info.libdirs[0] + + # get headers from static build, to be consistent (TBD if it's a good solution) + if not self.options.shared: copy(self, "*.h", includedir, join(self.build_folder, "include")) - copy(self, "*.dll", libdir, join(self.build_folder, "lib")) - copy(self, "*.lib", libdir, join(self.build_folder, "lib")) - copy(self, "*.a", libdir, join(self.build_folder, "lib")) - copy(self, "*.dylib", libdir, join(self.build_folder, "lib")) - copy(self, "*.so", libdir, join(self.build_folder, "lib")) - copy(self, "*.so.3", libdir, join(self.build_folder, "lib")) + + for lib in libs: + copy(self, lib + ".a", libdir, join(self.build_folder, "staticLib")) + else: + for lib in libs: + for ext in ["dll.a", "3.dylib", "dylib", "so.3", "so"]: + copy(self, lib + "." + ext, libdir, join(self.build_folder, "dynamicLib"))