Skip to content

Commit

Permalink
Handle polymorphic types for lib_root and include_root in setup.py
Browse files Browse the repository at this point in the history
Depending on whether these are created by pkg_config or not they might
be a list of directories or just a string with a single directory.
  • Loading branch information
adisbladis committed Apr 5, 2023
1 parent 943a7a8 commit d94239a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,17 @@ def build_extensions(self):
lib_root = include_root = root

if lib_root is not None:
for lib_dir in lib_root:
_add_directory(library_dirs, lib_dir)
if isinstance(lib_root, str):
_add_directory(library_dirs, lib_root)
else:
for lib_dir in lib_root:
_add_directory(library_dirs, lib_dir)
if include_root is not None:
for include_dir in include_root:
_add_directory(include_dirs, include_dir)
if isinstance(include_root, str):
_add_directory(include_dirs, include_root)
else:
for include_dir in include_root:
_add_directory(include_dirs, include_dir)

# respect CFLAGS/CPPFLAGS/LDFLAGS
for k in ("CFLAGS", "CPPFLAGS", "LDFLAGS"):
Expand Down

0 comments on commit d94239a

Please sign in to comment.