From: Stefan Behnel Date: Mon, 6 Aug 2007 06:19:48 +0000 (+0200) Subject: support 'language' option in distutils Extension X-Git-Tag: 0.9.6.14~29^2~129^2~20 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=f3df1464f4cef0137b83125e6717ae906b49fd28;p=cython.git support 'language' option in distutils Extension --- diff --git a/Cython/Distutils/build_ext.py b/Cython/Distutils/build_ext.py index 6b775e7e..7b55fb58 100644 --- a/Cython/Distutils/build_ext.py +++ b/Cython/Distutils/build_ext.py @@ -37,8 +37,12 @@ class build_ext (distutils.command.build_ext.build_ext): if not self.extensions: return + #suffix = self.swig_cpp and '.cpp' or '.c' + suffix = '.c' if extension is not None: module_name = extension.name + if extension.language == "c++": + suffix = ".cpp" else: module_name = None @@ -46,8 +50,6 @@ class build_ext (distutils.command.build_ext.build_ext): pyx_sources = [source for source in sources if 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: # should I raise an exception if it doesn't exist? if os.path.exists(pyx):