Skip to content

Commit

Permalink
(#6884) Build openssl for emscripten
Browse files Browse the repository at this point in the history
* Build openssl package for Emscripten. Disable things that are not compatible.

* remove disable things; some algorithms work faster with those options;

* remove unused things

* add validate

* remove unnecessary disabled things

* fix typo
  • Loading branch information
3d4m-volodymyr committed Aug 25, 2021
1 parent f402700 commit 3a6dfb9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions recipes/openssl/1.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class OpenSSLConan(ConanFile):
"no_asm": [True, False],
"enable_weak_ssl_ciphers": [True, False],
"386": [True, False],
"no_stdio": [True, False],
"no_tests": [True, False],
"no_sse2": [True, False],
"no_bf": [True, False],
"no_cast": [True, False],
Expand Down Expand Up @@ -172,6 +174,12 @@ def config_options(self):
else:
del self.options.fPIC

if self.settings.os == "Emscripten":
self.options.no_asm = True
self.options.no_threads = True
self.options.no_stdio = True
self.options.no_tests = True

def build_requirements(self):
if tools.os_info.is_windows:
if not self._win_bash:
Expand Down Expand Up @@ -848,6 +856,11 @@ def _module_file_rel_path(self):
return os.path.join(self._module_subfolder,
"conan-official-{}-variables.cmake".format(self.name))

def validate(self):
if self.settings.os == "Emscripten":
if not all((self.options.no_asm, self.options.no_threads, self.options.no_stdio, self.options.no_tests)):
raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,no_threads,no_stdio,no_tests}=True")

def package_info(self):
self.cpp_info.names["cmake_find_package"] = "OpenSSL"
self.cpp_info.names["cmake_find_package_multi"] = "OpenSSL"
Expand Down

0 comments on commit 3a6dfb9

Please sign in to comment.