Skip to content

Commit

Permalink
mpdecimal: Fix lib name on MSVC/shared, fix Mac cross-builds (#25889)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahajha authored Nov 11, 2024
1 parent 2ab569b commit b57c446
Showing 1 changed file with 8 additions and 9 deletions.
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")
else:
lib_pre_suf = ("lib", f"-{self.version}")
elif self.settings.os == "Windows":
if self.options.shared:
lib_pre_suf = ("", ".dll")
Expand Down

0 comments on commit b57c446

Please sign in to comment.