From 4119d3015b29b3eac582a431173970bd33a44cdf Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Thu, 2 May 2019 05:35:27 +0800 Subject: [PATCH] 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. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 5ccf7133d98..2c25543a9b8 100755 --- a/setup.py +++ b/setup.py @@ -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))