Skip to content

Commit

Permalink
openssl: set bitcode in templates instead of env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
kletoz committed Jan 17, 2023
1 parent 4dd960c commit fee9eda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions recipes/openssl/1.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,10 @@ def _create_targets(self):
if self.options.get_safe("fPIC", True):
shared_cflag='shared_cflag => "-fPIC",'

if self.settings.os in ["iOS", "tvOS", "watchOS"] and self.conf.get("tools.apple:enable_bitcode", check_type=bool):
cflags.append("-fembed-bitcode")
cxxflags.append("-fembed-bitcode")

config = config_template.format(targets=targets,
target=self._target,
ancestor=ancestor,
Expand Down
7 changes: 4 additions & 3 deletions recipes/openssl/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ def _create_targets(self):
if self.options.get_safe("fPIC", True):
shared_cflag = 'shared_cflag => "-fPIC",'

if self.settings.os in ["iOS", "tvOS", "watchOS"] and self.conf.get("tools.apple:enable_bitcode", check_type=bool):
cflags.append("-fembed-bitcode")
cxxflags.append("-fembed-bitcode")

config = config_template.format(
targets=targets,
target=self._target,
Expand Down Expand Up @@ -606,9 +610,6 @@ def build(self):
xcrun = tools.XCRun(self.settings)
env_vars["CROSS_SDK"] = os.path.basename(xcrun.sdk_path)
env_vars["CROSS_TOP"] = os.path.dirname(os.path.dirname(xcrun.sdk_path))
if self.settings.os in ["iOS", "tvOS", "watchOS"] and self.conf.get("tools.apple:enable_bitcode", check_type=bool):
cflags = " ".join(self._get_env_build().vars_dict["CFLAGS"])
env_vars["CFLAGS"] = "%s %s" % (cflags, "-fembed-bitcode")
with tools.environment_append(env_vars):
self._create_targets()
with self._make_context():
Expand Down

0 comments on commit fee9eda

Please sign in to comment.