aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build11
-rw-r--r--src/interfaces/libpq/meson.build5
-rw-r--r--src/interfaces/libpq/test/meson.build12
3 files changed, 20 insertions, 8 deletions
diff --git a/meson.build b/meson.build
index a38da92958d..ed9f4737d34 100644
--- a/meson.build
+++ b/meson.build
@@ -3078,6 +3078,16 @@ frontend_shlib_code = declare_dependency(
dependencies: [shlib_code, os_deps, libintl],
)
+# For frontend code that doesn't use fe_utils - this mainly exists for libpq's
+# tests, which are defined before fe_utils is defined, as fe_utils depends on
+# libpq.
+frontend_no_fe_utils_code = declare_dependency(
+ include_directories: [postgres_inc],
+ link_with: [common_static, pgport_static],
+ sources: generated_headers,
+ dependencies: [os_deps, libintl],
+)
+
# Dependencies both for static and shared libpq
libpq_deps += [
thread_dep,
@@ -3145,7 +3155,6 @@ subdir('src')
subdir('contrib')
subdir('src/test')
-subdir('src/interfaces/libpq/test')
subdir('src/interfaces/ecpg/test')
subdir('doc/src/sgml')
diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build
index ed2a4048d18..57fe8c3eaec 100644
--- a/src/interfaces/libpq/meson.build
+++ b/src/interfaces/libpq/meson.build
@@ -1,8 +1,5 @@
# Copyright (c) 2022-2024, PostgreSQL Global Development Group
-# test/ is entered via top-level meson.build, that way it can use the default
-# args for executables (which depend on libpq).
-
libpq_sources = files(
'fe-auth-scram.c',
'fe-auth.c',
@@ -107,6 +104,7 @@ install_data('pg_service.conf.sample',
install_dir: dir_data,
)
+subdir('test')
tests += {
'name': 'libpq',
@@ -125,6 +123,7 @@ tests += {
'with_gssapi': gssapi.found() ? 'yes' : 'no',
'with_krb_srvnam': 'postgres',
},
+ 'deps': libpq_test_deps,
},
}
diff --git a/src/interfaces/libpq/test/meson.build b/src/interfaces/libpq/test/meson.build
index 21dd37f69bc..16c0c00b6bc 100644
--- a/src/interfaces/libpq/test/meson.build
+++ b/src/interfaces/libpq/test/meson.build
@@ -1,5 +1,7 @@
# Copyright (c) 2022-2024, PostgreSQL Global Development Group
+libpq_test_deps = []
+
libpq_uri_regress_sources = files(
'libpq_uri_regress.c',
)
@@ -10,9 +12,9 @@ if host_system == 'windows'
'--FILEDESC', 'libpq test program',])
endif
-testprep_targets += executable('libpq_uri_regress',
+libpq_test_deps += executable('libpq_uri_regress',
libpq_uri_regress_sources,
- dependencies: [frontend_code, libpq],
+ dependencies: [frontend_no_fe_utils_code, libpq],
kwargs: default_bin_args + {
'install': false,
}
@@ -29,10 +31,12 @@ if host_system == 'windows'
'--FILEDESC', 'libpq test program',])
endif
-testprep_targets += executable('libpq_testclient',
+libpq_test_deps += executable('libpq_testclient',
libpq_testclient_sources,
- dependencies: [frontend_code, libpq],
+ dependencies: [frontend_no_fe_utils_code, libpq],
kwargs: default_bin_args + {
'install': false,
}
)
+
+testprep_targets += libpq_test_deps