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

mpdecimal: Fix lib name on MSVC/shared, fix Mac cross-builds #25889

Merged
merged 13 commits into from
Nov 11, 2024
17 changes: 8 additions & 9 deletions recipes/mpdecimal/2.5.x/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conan import ConanFile
from conan.tools.gnu import AutotoolsToolchain, AutotoolsDeps, Autotools
from conan.tools.gnu import AutotoolsToolchain, Autotools
from conan.tools.files import get, chdir, copy, export_conandata_patches, apply_conandata_patches, mkdir, rename
from conan.tools.layout import basic_layout
from conan.tools.build import cross_building
Expand Down Expand Up @@ -102,13 +102,9 @@ def generate(self):

tc = AutotoolsToolchain(self)
tc.configure_args.append("--enable-cxx" if self.options.cxx else "--disable-cxx")
tc.generate()

deps = AutotoolsDeps(self)
if is_apple_os(self) and self.settings.arch == "armv8":
deps.environment.append("LDFLAGS", ["-arch arm64"])
deps.environment.append("LDXXFLAGS", ["-arch arm64"])
deps.generate()
tc_env = tc.environment()
tc_env.append("LDXXFLAGS", ["$LDFLAGS"])
tc.generate(tc_env)

@property
def _dist_folder(self):
Expand Down Expand Up @@ -219,7 +215,10 @@ def package(self):
def package_info(self):
lib_pre_suf = ("", "")
if is_msvc(self):
lib_pre_suf = ("lib", f"-{self.version}")
if self.options.shared:
lib_pre_suf = ("lib", f"-{self.version}.dll")
jcar87 marked this conversation as resolved.
Show resolved Hide resolved
else:
lib_pre_suf = ("lib", f"-{self.version}")
elif self.settings.os == "Windows":
if self.options.shared:
lib_pre_suf = ("", ".dll")
Expand Down