Skip to content

Commit 5e5fab0

Browse files
committed
setup.py: don't prepend the system library directories when building extensions
For some reason the code assumes that relative paths are build paths prepends the system dirs after relative paths in the existing list. We only uses absolute paths though, and I don't understand why it even tries to do that. So just append the system dirs instead. This fixes the build trying to link against the system Python DLL in case it happens to be installed.
1 parent 05b95c2 commit 5e5fab0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

setup.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -889,10 +889,8 @@ def init_inc_lib_dirs(self):
889889
# (PYTHONFRAMEWORK is set) to avoid # linking problems when
890890
# building a framework with different architectures than
891891
# the one that is currently installed (issue #7473)
892-
add_dir_to_list(self.compiler.library_dirs,
893-
sysconfig.get_config_var("LIBDIR"))
894-
add_dir_to_list(self.compiler.include_dirs,
895-
sysconfig.get_config_var("INCLUDEDIR"))
892+
self.compiler.library_dirs.append(sysconfig.get_config_var("LIBDIR"))
893+
self.compiler.include_dirs.append(sysconfig.get_config_var("INCLUDEDIR"))
896894

897895
system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
898896
system_include_dirs = ['/usr/include']

0 commit comments

Comments
 (0)