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 authored and radarhere committed Jun 23, 2019
1 parent 32d1050 commit 4119d30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -386,8 +386,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 4119d30

Please sign in to comment.