Commit b306bc04 authored by Stefan Behnel's avatar Stefan Behnel

Fix compilation failure with Pythran 0.8.7.

parent 81124d4d
......@@ -35,9 +35,9 @@ except ImportError:
try:
import pythran
import pythran.config
PythranAvailable = True
pythran_version = pythran.__version__
except:
PythranAvailable = False
pythran_version = None
from .. import Utils
from ..Utils import (cached_function, cached_method, path_exists,
......@@ -129,9 +129,13 @@ def file_hash(filename):
def update_pythran_extension(ext):
if not PythranAvailable:
if not pythran_version:
raise RuntimeError("You first need to install Pythran to use the np_pythran directive.")
pythran_ext = pythran.config.make_extension()
pythran_ext = (
pythran.config.make_extension(python=True)
if pythran_version >= '0.9' or pythran_version >= '0.8.7'
else pythran.config.make_extension()
)
ext.include_dirs.extend(pythran_ext['include_dirs'])
ext.extra_compile_args.extend(pythran_ext['extra_compile_args'])
ext.extra_link_args.extend(pythran_ext['extra_link_args'])
......@@ -936,7 +940,7 @@ def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False,
safe_makedirs(options['common_utility_include_dir'])
pythran_options = None
if PythranAvailable:
if pythran_version:
pythran_options = CompilationOptions(**options)
pythran_options.cplus = True
pythran_options.np_pythran = True
......
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