Skip to content

Commit

Permalink
Merge pull request #2282 from mdboom/pycxx-fix-check
Browse files Browse the repository at this point in the history
Extend search path for PyCXX headers
  • Loading branch information
mdboom committed Aug 8, 2013
2 parents 71ed192 + 6b827cb commit 87d25ff
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,17 +699,12 @@ def check(self):
return self._check_for_pkg_config(
'PyCXX', 'CXX/Extensions.hxx', min_version='6.2.4')
except CheckFailed as e:
# Since there is no .pc file for PyCXX upstream, many
# distros don't package it either. We don't necessarily
# need to fall back to a local build in that scenario if
# the header files can be found.
base_include_dirs = [
os.path.join(x, 'include') for x in get_base_dirs()]
if has_include_file(base_include_dirs, 'CXX/Extensions.hxx'):
return 'Using system CXX (version unknown, no pkg-config info)'
else:
self.__class__.found_external = False
return str(e) + ' Using local copy.'
# It's ok to just proceed here, since the `import CXX`
# worked above, and PyCXX (at least upstream) ensures that
# its header files are on the default distutils include
# path (either in a standard C place such as /usr/include,
# or in /usr/include/pythonX.Y.
return 'Using system CXX (version unknown, no pkg-config info)'

def add_flags(self, ext):
if self.found_external and not 'sdist' in sys.argv:
Expand Down

0 comments on commit 87d25ff

Please sign in to comment.