Skip to content

Commit

Permalink
refactor conanfile:
Browse files Browse the repository at this point in the history
* include `openssl` only (ignore zlib)
* get headers only from `static` build
* include only `libcrypto` and `libssl` (ignore fips/legacy providers)
  • Loading branch information
whyoleg committed Dec 29, 2023
1 parent fbd39da commit 2762d1b
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions packages/openssl3/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

0 comments on commit 2762d1b

Please sign in to comment.