Commit 69fe83ac authored by Kacper Kowalik's avatar Kacper Kowalik

Ensure that extension's include_dirs is a list

This change allows to pass generator (e.g. itertools.chain) as
include_dirs if for some reason evaluation of include directories needs
to be delayed e.g. due to simultaneous dependency on cython and numpy.
parent 137c064f
......@@ -86,7 +86,7 @@ class build_ext(_build_ext.build_ext):
"generate debug information for cygdb"),
('cython-compile-time-env', None,
"cython compile time environment"),
# For backwards compatibility.
('pyrex-cplus', None,
"generate C++ source files"),
......@@ -109,7 +109,7 @@ class build_ext(_build_ext.build_ext):
boolean_options.extend([
'cython-cplus', 'cython-create-listing', 'cython-line-directives',
'cython-c-in-temp', 'cython-gdb',
# For backwards compatibility.
'pyrex-cplus', 'pyrex-create-listing', 'pyrex-line-directives',
'pyrex-c-in-temp', 'pyrex-gdb',
......@@ -127,7 +127,7 @@ class build_ext(_build_ext.build_ext):
self.cython_gdb = False
self.no_c_in_traceback = 0
self.cython_compile_time_env = None
def __getattr__(self, name):
if name[:6] == 'pyrex_':
return getattr(self, 'cython_' + name[6:])
......@@ -236,6 +236,10 @@ class build_ext(_build_ext.build_ext):
includes.append(i)
except AttributeError:
pass
# In case extension.include_dirs is a generator, evaluate it and keep
# result
extension.include_dirs = list(extension.include_dirs)
for i in extension.include_dirs:
if not i in includes:
includes.append(i)
......
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