Re: meson: Allow disabling static libraries
Tristan Partin <tristan@partin.io>
From: "Tristan Partin" <tristan@partin.io>
To: "Peter Eisentraut" <peter@eisentraut.org>
Cc: "pgsql-hackers" <pgsql-hackers@postgresql.org>
Date: 2026-01-20T16:22:26Z
Lists: pgsql-hackers
On Tue Jan 20, 2026 at 1:04 AM CST, Peter Eisentraut wrote: > This patch allows disabling the build of static libraries using the > standard meson option -Ddefault_library=shared (defaults to "both"). > This option would work out of the box if you use the library() function > to build libraries, but we use shared_library() and static_library() > separately, for reasons that are explained in > src/interfaces/libpq/meson.build. So now with this, the option works > again as expected from the end user's perspective. > > This approach was suggested by Tristan Partin over in the AIX thread[0], > but I figured this could be a generally usable feature, as some > distributions don't want to build static libraries. > > For illustration and continuous testing, I disabled static libraries in > the CI SanityCheck task. Maybe a better test would be to install the build tree into a DESTDIR, and then do a `find $DESTDIR -type f -name '*.a'` and confirm that no static libraries were installed. Otherwise, the patch looks good. -- Tristan Partin Databricks (https://databricks.com)
Commits
-
meson: allow disabling building/installation of static libraries.
- 78727dcba32e 19 (unreleased) landed
-
meson: Refactor libpq targets variables
- 4bfbbeb679c0 19 (unreleased) landed