Skip to content

Commit

Permalink
pbc: add AutotoolsDeps workaround for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Jan 20, 2024
1 parent 8cf882b commit 612f854
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions recipes/pbc/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,20 @@ def generate(self):
min_ios = f"-miphoneos-version-min={self.settings.os.version}"
tc.configure_args.append(f"CC={xcr.cc} -isysroot {xcr.sdk_path} -target {target} {min_ios}")
tc.generate()
deps = AutotoolsDeps(self)
deps.generate()

if not is_msvc(self):
deps = AutotoolsDeps(self)
deps.generate()
else:
# Custom AutotoolsDeps for cl like compilers
# workaround for https://github.com/conan-io/conan/issues/12784
gmp_info = self.dependencies["gmp"].cpp_info
env = Environment()
env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in gmp_info.includedirs] + [f"-D{d}" for d in gmp_info.defines])
env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in (gmp_info.libs + gmp_info.system_libs)])
env.append("LDFLAGS", [f"-LIBPATH:{unix_path(self, p)}" for p in gmp_info.libdirs] + gmp_info.sharedlinkflags + gmp_info.exelinkflags)
env.append("CFLAGS", gmp_info.cflags)
env.vars(self).save_script("conanautotoolsdeps_cl_workaround")

if is_msvc(self):
env = Environment()
Expand Down

0 comments on commit 612f854

Please sign in to comment.