rework setup.py to make android build been able to generate cython itself

This commit is contained in:
Mathieu Virbel 2011-04-27 14:12:58 +02:00
parent 07349f10ac
commit 112b00a2d9
1 changed files with 7 additions and 1 deletions

View File

@ -8,9 +8,11 @@ from distutils.extension import Extension
try:
# check for cython
from Cython.Distutils import build_ext
have_cython = True
except ImportError:
print '\nCython is missing, its required for compiling kivy !\n\n'
raise
have_cython = False
from distutils.command.build_ext import build_ext
# extract version (simulate doc generation, kivy will be not imported)
environ['KIVY_DOC_INCLUDE'] = '1'
@ -105,6 +107,10 @@ for root, dirnames, filenames in walk(join(dirname(__file__), 'kivy')):
for filename in fnfilter(filenames, '*.pyx'):
pyx_files.append(join(root, filename))
if not have_cython:
pyx_files = pyx_files = ['%s.c' % x[:-4] for x in pyx_files]
pxd_files = []
# add cython core extension modules if cython is available
if True: