Default to using cython if cythonized files not found
This commit is contained in:
11
setup.py
11
setup.py
@@ -3,12 +3,6 @@ from __future__ import print_function
|
|||||||
|
|
||||||
use_cython = False
|
use_cython = False
|
||||||
|
|
||||||
import pkg_resources
|
|
||||||
setuptools_version = pkg_resources.get_distribution("setuptools").version
|
|
||||||
if setuptools_version < '0.8':
|
|
||||||
# older versions of setuptools don't work with cython
|
|
||||||
use_cython = False
|
|
||||||
|
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@@ -66,6 +60,11 @@ class clean(_clean):
|
|||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# set use_cython if lib/capnp.cpp is not detected
|
||||||
|
capnp_compiled_file = os.path.join(os.path.dirname(__file__), 'capnp', 'lib', 'capnp.cpp')
|
||||||
|
if not os.path.isfile(capnp_compiled_file):
|
||||||
|
use_cython = True
|
||||||
|
|
||||||
# hack to parse commandline arguments
|
# hack to parse commandline arguments
|
||||||
force_bundled_libcapnp = "--force-bundled-libcapnp" in sys.argv
|
force_bundled_libcapnp = "--force-bundled-libcapnp" in sys.argv
|
||||||
if force_bundled_libcapnp:
|
if force_bundled_libcapnp:
|
||||||
|
|||||||
Reference in New Issue
Block a user