Add pg_config libdir to the library's rpath

Close #1356.
This commit is contained in:
Giorgos Tzampanakis 2021-09-22 15:56:46 +03:00
parent 3430dcdee6
commit 99262a2b97

View File

@ -74,6 +74,7 @@ Operating System :: Unix
version_flags = ['dt', 'dec'] version_flags = ['dt', 'dec']
PLATFORM_IS_WINDOWS = sys.platform.lower().startswith('win') PLATFORM_IS_WINDOWS = sys.platform.lower().startswith('win')
PLATFORM_IS_LINUX = sys.platform.lower().startswith('linux')
class PostgresConfig: class PostgresConfig:
@ -372,7 +373,10 @@ For further information please check the 'doc/src/install.rst' file (also at
self.libraries.append("pq") self.libraries.append("pq")
try: 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"))
self.include_dirs.append(pg_config_helper.query("includedir-server")) self.include_dirs.append(pg_config_helper.query("includedir-server"))