Skip to content

Commit

Permalink
setup.py: don't prepend the system library directories when building …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
lazka committed Aug 27, 2023
1 parent 25d9719 commit d3c3408
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,8 @@ def init_inc_lib_dirs(self):
# (PYTHONFRAMEWORK is set) to avoid # linking problems when
# building a framework with different architectures than
# the one that is currently installed (issue #7473)
add_dir_to_list(self.compiler.library_dirs,
sysconfig.get_config_var("LIBDIR"))
add_dir_to_list(self.compiler.include_dirs,
sysconfig.get_config_var("INCLUDEDIR"))
self.compiler.library_dirs.append(sysconfig.get_config_var("LIBDIR"))
self.compiler.include_dirs.append(sysconfig.get_config_var("INCLUDEDIR"))

system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
system_include_dirs = ['/usr/include']
Expand Down

0 comments on commit d3c3408

Please sign in to comment.