Skip to content

Commit 28dfd36

Browse files
Deal with pkg-config not being present in setuppy (windows)
1 parent 7a4b5f3 commit 28dfd36

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

setup.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
LZ4_REQUIRED_VERSION = '>= 1.7.5'
1010
PY3C_REQUIRED_VERSION = '>= 1.0'
1111

12-
# Check to see if we have a lz4 library installed on the system and
13-
# use it if so. If not, we'll use the bundled library.
14-
liblz4_found = pkgconfig.installed ('liblz4', LZ4_REQUIRED_VERSION)
15-
16-
# Check to see if we have the py3c headers installed on the system and
17-
# use it if so. If not, we'll use the bundled library.
18-
py3c_found = pkgconfig.installed('py3c', PY3C_REQUIRED_VERSION)
12+
# Check to see if we have a lz4 and py3c libraries installed on the system, and
13+
# of suitable versions, and use if so. If not, we'll use the bundled libraries.
14+
try:
15+
liblz4_found = pkgconfig.installed ('liblz4', LZ4_REQUIRED_VERSION)
16+
py3c_found = pkgconfig.installed('py3c', PY3C_REQUIRED_VERSION)
17+
except EnvironmentError:
18+
# Windows, no pkg-config present
19+
liblz4_found = False
20+
py3c_found = False
1921

2022
# Set up the extension modules. If a system wide lz4 library is found, and is
2123
# recent enough, we'll use that. Otherwise we'll build with the bundled one. If

0 commit comments

Comments
 (0)