Skip to content

Commit 726b0e6

Browse files
committed
meson: Fix libpq header include order.
On systems using -Dextra_include_dir that happen to have a copy of libpq installed there, it's important to put the libpq header search path ahead of -Dextra_include_dir. Reorder the dependencies to achieve that. This matches the order used by configure. Back-patch to 16, where meson arrived. Reviewed-by: Discussion: https://postgr.es/m/CA+hUKGKispvxLyrBn3=3mp0BB1N+RBYR5eE2guCOksnwEoOcPQ@mail.gmail.com
1 parent 0951942 commit 726b0e6

File tree

25 files changed

+37
-35
lines changed

25 files changed

+37
-35
lines changed

contrib/dblink/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ endif
1313
dblink = shared_module('dblink',
1414
dblink_sources,
1515
kwargs: contrib_mod_args + {
16-
'dependencies': contrib_mod_args['dependencies'] + [libpq],
16+
'dependencies': [libpq] + contrib_mod_args['dependencies'],
1717
},
1818
)
1919
contrib_targets += dblink

contrib/oid2name/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ endif
1212

1313
oid2name = executable('oid2name',
1414
oid2name_sources,
15-
dependencies: [frontend_code, libpq],
15+
dependencies: [libpq, frontend_code],
1616
kwargs: default_bin_args,
1717
)
1818
contrib_targets += oid2name

contrib/postgres_fdw/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif
1717
postgres_fdw = shared_module('postgres_fdw',
1818
postgres_fdw_sources,
1919
kwargs: contrib_mod_args + {
20-
'dependencies': contrib_mod_args['dependencies'] + [libpq],
20+
'dependencies': [libpq] + contrib_mod_args['dependencies'],
2121
},
2222
)
2323
contrib_targets += postgres_fdw

contrib/vacuumlo/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ endif
1212

1313
vacuumlo = executable('vacuumlo',
1414
vacuumlo_sources,
15-
dependencies: [frontend_code, libpq],
15+
dependencies: [libpq, frontend_code],
1616
kwargs: default_bin_args,
1717
)
1818
contrib_targets += vacuumlo

src/backend/replication/libpqwalreceiver/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ libpqwalreceiver = shared_module('pqwalreceiver',
1414
libpqwalreceiver_sources,
1515
kwargs: pg_mod_args + {
1616
'name_prefix': 'lib',
17-
'dependencies': pg_mod_args['dependencies'] + [libpq],
17+
'dependencies': [libpq] + pg_mod_args['dependencies'],
1818
}
1919
)
2020

src/bin/initdb/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ initdb = executable('initdb',
2121
# shared library from a different PG version. Define
2222
# USE_PRIVATE_ENCODING_FUNCS to ensure that that happens.
2323
c_args: ['-DUSE_PRIVATE_ENCODING_FUNCS'],
24-
dependencies: [frontend_code, libpq, icu, icu_i18n],
24+
dependencies: [libpq, frontend_code, icu, icu_i18n],
2525
kwargs: default_bin_args,
2626
)
2727
bin_targets += initdb

src/bin/pg_amcheck/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ endif
1212

1313
pg_amcheck = executable('pg_amcheck',
1414
pg_amcheck_sources,
15-
dependencies: [frontend_code, libpq],
15+
dependencies: [libpq, frontend_code],
1616
kwargs: default_bin_args,
1717
)
1818
bin_targets += pg_amcheck

src/bin/pg_basebackup/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ common_sources = files(
77
'walmethods.c',
88
)
99

10-
pg_basebackup_deps = [frontend_code, libpq, lz4, zlib, zstd]
10+
pg_basebackup_deps = [libpq, frontend_code, lz4, zlib, zstd]
1111
pg_basebackup_common = static_library('libpg_basebackup_common',
1212
common_sources,
1313
dependencies: pg_basebackup_deps,
@@ -45,7 +45,7 @@ endif
4545

4646
pg_createsubscriber = executable('pg_createsubscriber',
4747
pg_createsubscriber_sources,
48-
dependencies: [frontend_code, libpq],
48+
dependencies: [libpq, frontend_code],
4949
kwargs: default_bin_args,
5050
)
5151
bin_targets += pg_createsubscriber

src/bin/pg_combinebackup/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif
1717

1818
pg_combinebackup = executable('pg_combinebackup',
1919
pg_combinebackup_sources,
20-
dependencies: [frontend_code],
20+
dependencies: [libpq, frontend_code],
2121
kwargs: default_bin_args,
2222
)
2323
bin_targets += pg_combinebackup

src/bin/pg_dump/meson.build

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pg_dump_common_sources = files(
2222
pg_dump_common = static_library('libpgdump_common',
2323
pg_dump_common_sources,
2424
c_pch: pch_postgres_fe_h,
25-
dependencies: [frontend_code, libpq, lz4, zlib, zstd],
25+
dependencies: [libpq, frontend_code, lz4, zlib, zstd],
2626
kwargs: internal_lib_args,
2727
)
2828

@@ -42,7 +42,7 @@ endif
4242
pg_dump = executable('pg_dump',
4343
pg_dump_sources,
4444
link_with: [pg_dump_common],
45-
dependencies: [frontend_code, libpq, zlib],
45+
dependencies: [libpq, frontend_code, zlib],
4646
kwargs: default_bin_args,
4747
)
4848
bin_targets += pg_dump
@@ -61,7 +61,7 @@ endif
6161
pg_dumpall = executable('pg_dumpall',
6262
pg_dumpall_sources,
6363
link_with: [pg_dump_common],
64-
dependencies: [frontend_code, libpq, zlib],
64+
dependencies: [libpq, frontend_code, zlib],
6565
kwargs: default_bin_args,
6666
)
6767
bin_targets += pg_dumpall
@@ -80,7 +80,7 @@ endif
8080
pg_restore = executable('pg_restore',
8181
pg_restore_sources,
8282
link_with: [pg_dump_common],
83-
dependencies: [frontend_code, libpq, zlib],
83+
dependencies: [libpq, frontend_code, zlib],
8484
kwargs: default_bin_args,
8585
)
8686
bin_targets += pg_restore

0 commit comments

Comments
 (0)