Skip to content

Extend search path for PyCXX headers #2282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,17 +695,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