Skip to content

Commit

Permalink
Remove debug_suffix and make it optional for openssl > 1.1.0 for whic…
Browse files Browse the repository at this point in the history
…h it was explicitly added despite it not being there in upstream
  • Loading branch information
Sil3ntStorm committed May 24, 2022
1 parent 4946889 commit 159d5a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions recipes/openssl/1.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ class OpenSSLConan(ConanFile):
"capieng_dialog": [True, False],
"enable_capieng": [True, False],
"openssldir": "ANY",
"debug_suffix": [True, False],
}
default_options = {key: False for key in options.keys()}
default_options["fPIC"] = True
default_options["openssldir"] = None
default_options["debug_suffix"] = True

_env_build = None

Expand Down Expand Up @@ -198,6 +200,9 @@ def config_options(self):
del self.options.no_srp
del self.options.no_ts
del self.options.no_whirlpool
del self.options.debug_suffix
elif not self._use_nmake:
del self.options.debug_suffix

if self._full_version < "1.1.1":
del self.options.no_aria
Expand Down Expand Up @@ -790,7 +795,7 @@ def package(self):
if fnmatch.fnmatch(filename, "*.pdb"):
os.unlink(os.path.join(self.package_folder, root, filename))
if self._use_nmake:
if self.settings.build_type == 'Debug' and self._full_version >= "1.1.0":
if self.settings.build_type == 'Debug' and self._full_version >= "1.1.0" and self.options.debug_suffix:
with tools.chdir(os.path.join(self.package_folder, 'lib')):
rename(self, "libssl.lib", "libssld.lib")
rename(self, "libcrypto.lib", "libcryptod.lib")
Expand Down Expand Up @@ -862,11 +867,11 @@ def package_info(self):
self.cpp_info.components["ssl"].set_property("cmake_target_name", "OpenSSL::SSL")
self.cpp_info.components["ssl"].set_property("pkg_config_name", "libssl")
if self._use_nmake:
libsuffix = "d" if self.settings.build_type == "Debug" else ""
if self._full_version < "1.1.0":
self.cpp_info.components["ssl"].libs = ["ssleay32"]
self.cpp_info.components["crypto"].libs = ["libeay32"]
else:
libsuffix = "d" if self.options.debug_suffix and self.settings.build_type == "Debug" else ""
self.cpp_info.components["ssl"].libs = ["libssl" + libsuffix]
self.cpp_info.components["crypto"].libs = ["libcrypto" + libsuffix]
else:
Expand Down

0 comments on commit 159d5a1

Please sign in to comment.