From 7ee693dd654e52369c21865de4c908c976a2db43 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 8eb0b3c6b33..68d2d6b55be 100755 --- a/setup.py +++ b/setup.py @@ -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))