summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@googlemail.com>2015-06-09 07:49:13 +0200
committerRalf Gommers <ralf.gommers@googlemail.com>2015-06-09 07:49:13 +0200
commit7d867925e6aa634136e85511cfe7ddbe41c88f74 (patch)
treec456b0945930fdd099abdb5fdf8375e3593def0a /numpy
parent01c59d63ad0356650571e239fffb9e7ee38c4c08 (diff)
parentb08f369554e6d6b231c941740f6c852a45edcc12 (diff)
downloadnumpy-7d867925e6aa634136e85511cfe7ddbe41c88f74.tar.gz
Merge pull request #5866 from tdsmith/include_dirs
MAINT: can't find Python.h when build_ext --include-dirs is set
Diffstat (limited to 'numpy')
-rw-r--r--numpy/distutils/command/build_ext.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py
index 59c453607..c588204e5 100644
--- a/numpy/distutils/command/build_ext.py
+++ b/numpy/distutils/command/build_ext.py
@@ -54,10 +54,24 @@ class build_ext (old_build_ext):
self.jobs = int(self.jobs)
except ValueError:
raise ValueError("--jobs/-j argument must be an integer")
- incl_dirs = self.include_dirs
+
+ # Ensure that self.include_dirs and self.distribution.include_dirs
+ # refer to the same list object. finalize_options will modify
+ # self.include_dirs, but self.distribution.include_dirs is used
+ # during the actual build.
+ # self.include_dirs is None unless paths are specified with
+ # --include-dirs.
+ # The include paths will be passed to the compiler in the order:
+ # numpy paths, --include-dirs paths, Python include path.
+ if isinstance(self.include_dirs, str):
+ self.include_dirs = self.include_dirs.split(os.pathsep)
+ incl_dirs = self.include_dirs or []
+ if self.distribution.include_dirs is None:
+ self.distribution.include_dirs = []
+ self.include_dirs = self.distribution.include_dirs
+ self.include_dirs.extend(incl_dirs)
+
old_build_ext.finalize_options(self)
- if incl_dirs is not None:
- self.include_dirs.extend(self.distribution.include_dirs or [])
self.set_undefined_options('build', ('jobs', 'jobs'))
def run(self):