Include CPPFLAGS when searching for libraries

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.
This commit is contained in:
Jeffery To 2019-05-02 05:35:27 +08:00 committed by Andrew Murray
parent 32d10505a3
commit 4119d3015b

View File

@ -386,8 +386,8 @@ class pil_build_ext(build_ext):
_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))