Commit f3df1464 authored by Stefan Behnel's avatar Stefan Behnel

support 'language' option in distutils Extension

parent 1d4ec60a
...@@ -37,8 +37,12 @@ class build_ext (distutils.command.build_ext.build_ext): ...@@ -37,8 +37,12 @@ class build_ext (distutils.command.build_ext.build_ext):
if not self.extensions: if not self.extensions:
return return
#suffix = self.swig_cpp and '.cpp' or '.c'
suffix = '.c'
if extension is not None: if extension is not None:
module_name = extension.name module_name = extension.name
if extension.language == "c++":
suffix = ".cpp"
else: else:
module_name = None module_name = None
...@@ -46,8 +50,6 @@ class build_ext (distutils.command.build_ext.build_ext): ...@@ -46,8 +50,6 @@ class build_ext (distutils.command.build_ext.build_ext):
pyx_sources = [source for source in sources if source.endswith('.pyx')] pyx_sources = [source for source in sources if source.endswith('.pyx')]
other_sources = [source for source in sources if not source.endswith('.pyx')] other_sources = [source for source in sources if not source.endswith('.pyx')]
#suffix = self.swig_cpp and '.cpp' or '.c'
suffix = '.c'
for pyx in pyx_sources: for pyx in pyx_sources:
# should I raise an exception if it doesn't exist? # should I raise an exception if it doesn't exist?
if os.path.exists(pyx): if os.path.exists(pyx):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment