From a8765121d973f74dd97d8bc4806736ba754ac3e6 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sat, 4 Jan 2025 16:20:20 +0100 Subject: [PATCH] fix(ci): handle other pg_config options required by setup.py --- .../pg_config_vcpkg_stub/__init__.py | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/build/pg_config_vcpkg_stub/pg_config_vcpkg_stub/__init__.py b/scripts/build/pg_config_vcpkg_stub/pg_config_vcpkg_stub/__init__.py index 89935662b..eb049e68c 100644 --- a/scripts/build/pg_config_vcpkg_stub/pg_config_vcpkg_stub/__init__.py +++ b/scripts/build/pg_config_vcpkg_stub/pg_config_vcpkg_stub/__init__.py @@ -39,11 +39,18 @@ def _main() -> None: raise ScriptError(f"libpq library not found: {f}") print(vcpkg_platform_root.joinpath("lib")) - elif args.includedir: + elif args.includedir or args.includedir_server: + # NOTE: on linux, the includedir-server dir contains pg_config.h + # which we need because it includes the PG_VERSION_NUM macro. + # In the vcpkg directory this file is in the includedir directory, + # therefore we return the same value. if not (d := vcpkg_platform_root / "include/libpq").is_dir(): raise ScriptError(f"libpq include directory not found: {d}") print(vcpkg_platform_root.joinpath("include")) + elif args.cppflags or args.ldflags: + print("") + else: raise ScriptError("command not handled") @@ -63,6 +70,21 @@ def parse_cmdline() -> Namespace: action="store_true", help="show location of C header files of the client interfaces", ) + g.add_argument( + "--includedir-server", + action="store_true", + help="show location of C header files for the server", + ) + g.add_argument( + "--cppflags", + action="store_true", + help="(dummy) show CPPFLAGS value used when PostgreSQL was built", + ) + g.add_argument( + "--ldflags", + action="store_true", + help="(dummy) show LDFLAGS value used when PostgreSQL was built", + ) opt = parser.parse_args() return opt