|
|
|
@ -149,10 +149,11 @@ def check_and_update_cythonization(extensions): |
|
|
|
|
for source in extension.sources: |
|
|
|
|
base, file_ext = os.path.splitext(source) |
|
|
|
|
if file_ext == '.pyx': |
|
|
|
|
generated_pyx_source = next((base + gen_ext for gen_ext in ( |
|
|
|
|
'.c', |
|
|
|
|
'.cpp', |
|
|
|
|
) if os.path.isfile(base + gen_ext)), None) |
|
|
|
|
generated_pyx_source = next( |
|
|
|
|
(base + gen_ext for gen_ext in ( |
|
|
|
|
'.c', |
|
|
|
|
'.cpp', |
|
|
|
|
) if os.path.isfile(base + gen_ext)), None) |
|
|
|
|
if generated_pyx_source: |
|
|
|
|
generated_pyx_sources.append(generated_pyx_source) |
|
|
|
|
else: |
|
|
|
@ -194,7 +195,8 @@ def try_cythonize(extensions, linetracing=False, mandatory=True): |
|
|
|
|
return Cython.Build.cythonize( |
|
|
|
|
extensions, |
|
|
|
|
include_path=[ |
|
|
|
|
include_dir for extension in extensions |
|
|
|
|
include_dir |
|
|
|
|
for extension in extensions |
|
|
|
|
for include_dir in extension.include_dirs |
|
|
|
|
] + [CYTHON_STEM], |
|
|
|
|
compiler_directives=cython_compiler_directives) |
|
|
|
@ -215,9 +217,10 @@ class BuildExt(build_ext.build_ext): |
|
|
|
|
"""Test if default compiler is okay with specifying c++ version |
|
|
|
|
when invokec in C mode. GCC is okay with this, while clang is not. |
|
|
|
|
""" |
|
|
|
|
cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', '-'], |
|
|
|
|
stdout=subprocess.PIPE, |
|
|
|
|
stderr=subprocess.PIPE) |
|
|
|
|
cc_test = subprocess.Popen( |
|
|
|
|
['cc', '-x', 'c', '-std=c++11', '-'], |
|
|
|
|
stdout=subprocess.PIPE, |
|
|
|
|
stderr=subprocess.PIPE) |
|
|
|
|
_, cc_err = cc_test.communicate(input='int main(){return 0;}') |
|
|
|
|
return not 'invalid argument' in cc_err |
|
|
|
|
|
|
|
|
|