Skip to content

Commit

Permalink
Add pg_config libdir to the library's rpath
Browse files Browse the repository at this point in the history
Close #1356.
  • Loading branch information
Giorgos Tzampanakis committed Sep 22, 2021
1 parent 3430dcd commit 99262a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
version_flags = ['dt', 'dec']

PLATFORM_IS_WINDOWS = sys.platform.lower().startswith('win')
PLATFORM_IS_LINUX = sys.platform.lower().startswith('linux')


class PostgresConfig:
Expand Down Expand Up @@ -372,7 +373,10 @@ def finalize_options(self):
self.libraries.append("pq")

try:
self.library_dirs.append(pg_config_helper.query("libdir"))
pg_config_libdir = pg_config_helper.query("libdir")
self.library_dirs.append(pg_config_libdir)
if PLATFORM_IS_LINUX:
self.rpath.append(pg_config_libdir)
self.include_dirs.append(pg_config_helper.query("includedir"))
self.include_dirs.append(pg_config_helper.query("includedir-server"))

Expand Down

0 comments on commit 99262a2

Please sign in to comment.