Skip to content

Commit

Permalink
fix(ci): handle other pg_config options required by setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarrazzo committed Jan 4, 2025
1 parent bb52bcf commit a876512
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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

Expand Down

0 comments on commit a876512

Please sign in to comment.