Permalink
Browse files

workaround for bug in distutils that prevents one from compiling both…

… C and C++ shared objects in the same setup file normally
  • Loading branch information...
grouse
grouse committed Apr 19, 2004
1 parent cabdb84 commit a151e5c61948ec1a64d183225185235887b42f20
Showing with 15 additions and 2 deletions.
  1. +15 −2 setup.py
View
@@ -154,6 +154,19 @@ def run(self):
)
build_ext.run(self)
+ def build_extensions(self):
+ self._original_compiler_so = self.compiler.compiler_so
+
+ build_ext.build_extensions(self)
+
+ def build_extension(self, ext):
+ if ext.language == "c++":
+ self.compiler.compiler_so = self.compiler.compiler_cxx
+ else:
+ self.compiler.compiler_so = self._original_compiler_so
+
+ build_ext.build_extension(self, ext)
+
class test_biopython(Command):
"""Run all of the tests for the package.
@@ -373,8 +386,8 @@ def is_reportlab_installed():
libraries=["fl"]
),
Extension('Bio.KDTree._CKDTree',
- ["Bio/KDTree/KDTree.C",
- "Bio/KDTree/KDTree.swig.C"],
+ ["Bio/KDTree/KDTree.cxx",
+ "Bio/KDTree/KDTree.swig.cxx"],
libraries=["stdc++"],
language="c++"
),

0 comments on commit a151e5c

Please sign in to comment.