Commit 158b463e authored by Jason R. Coombs's avatar Jason R. Coombs

Merged in lsinger/setuptools (pull request #39)

Map .pyx sources to .c or .cpp depending on language
parents 7a47250f a0c7e67a
......@@ -27,8 +27,19 @@ class Extension(_Extension):
def __init__(self, *args, **kw):
_Extension.__init__(self, *args, **kw)
if not have_pyrex():
if self.language.lower() == 'c++':
self._convert_pyx_sources_to_cpp()
else:
self._convert_pyx_sources_to_c()
def _convert_pyx_sources_to_cpp(self):
"convert .pyx extensions to .cpp"
def pyx_to_c(source):
if source.endswith('.pyx'):
source = source[:-4] + '.cpp'
return source
self.sources = list(map(pyx_to_c, self.sources))
def _convert_pyx_sources_to_c(self):
"convert .pyx extensions to .c"
def pyx_to_c(source):
......
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