Skip to content

Commit

Permalink
Include CPPFLAGS when searching for libraries
Browse files Browse the repository at this point in the history
This adds CPPFLAGS to the list of environment variables (currently
CFLAGS and LDFLAGS) searched when looking for includes and library
directories, as CPPFLAGS may also include -I options.
  • Loading branch information
jefferyto committed May 1, 2019
1 parent af5c913 commit 7ee693d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -330,8 +330,8 @@ def build_extensions(self):
_add_directory(library_dirs, lib_root)
_add_directory(include_dirs, include_root)

# respect CFLAGS/LDFLAGS
for k in ('CFLAGS', 'LDFLAGS'):
# respect CFLAGS/CPPFLAGS/LDFLAGS
for k in ('CFLAGS', 'CPPFLAGS', 'LDFLAGS'):
if k in os.environ:
for match in re.finditer(r'-I([^\s]+)', os.environ[k]):
_add_directory(include_dirs, match.group(1))
Expand Down

0 comments on commit 7ee693d

Please sign in to comment.