Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix windows clang compilation for ffi #9988

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion recipes/libffi/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,16 @@ def _patch_sources(self):
@contextlib.contextmanager
def _build_context(self):
extra_env_vars = {}
if self._is_msvc:
if tools.os_info.is_windows:
AndreyMlashkin marked this conversation as resolved.
Show resolved Hide resolved
msvcc = tools.unix_path(os.path.join(self.source_folder, self._source_subfolder, "msvcc.sh"))
msvcc_args = []
if self.settings.arch == "x86_64":
msvcc_args.append("-m64")
elif self.settings.arch == "x86":
msvcc_args.append("-m32")
if self.settings.compiler == "clang":
msvcc_args.append("-clang-cl")

if msvcc_args:
msvcc = "{} {}".format(msvcc, " ".join(msvcc_args))
extra_env_vars.update(tools.vcvars_dict(self.settings))
Expand Down Expand Up @@ -178,3 +181,4 @@ def package_info(self):
self.cpp_info.libs = ["{}ffi".format("lib" if self._is_msvc else "")]
if not self.options.shared:
self.cpp_info.defines = ["FFI_BUILDING"]