From 8f8517a785218ea6507d179b25067a31152d08d4 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 14 Aug 2024 18:03:31 -0700 Subject: [PATCH] fix injection of -dynamiclib setuptools v72.2.0 introduces linker_so_cxx --- src/setuptools_dso/dsocmd.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/setuptools_dso/dsocmd.py b/src/setuptools_dso/dsocmd.py index b39cedb..c911892 100644 --- a/src/setuptools_dso/dsocmd.py +++ b/src/setuptools_dso/dsocmd.py @@ -347,9 +347,11 @@ def run(self): # fixup for MAC to build dylib (MH_DYLIB) instead of bundle (MH_BUNDLE) if sys.platform == 'darwin': - for i,val in enumerate(self.compiler.linker_so): - if val=='-bundle': - self.compiler.linker_so[i] = '-dynamiclib' + for attr in ('linker_so', 'linker_so_cxx'): + linker_so = getattr(self.compiler, attr, []) + for i,val in enumerate(linker_so): + if val=='-bundle': + linker_so[i] = '-dynamiclib' for dso in self.dsos: self.build_dso(dso)