meson: Allow disabling static libraries - Mailing list pgsql-hackers

From Peter Eisentraut
Subject meson: Allow disabling static libraries
Date
Msg-id e8aa97db-872b-4087-b073-f296baae948d@eisentraut.org
Whole thread Raw
Responses Re: meson: Allow disabling static libraries
Re: meson: Allow disabling static libraries
List pgsql-hackers
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.

The internal use static libraries like libpgcommon.a are still built in 
any case, but if you disable static libraries, they are not installed.

The opposite case of disabling shared libraries doesn't work at the 
moment.  I think that is much less useful, but if someone wanted to, 
they could implement it in this same framework.


[0]: 

https://www.postgresql.org/message-id/SJ4PPFB817783261597674B9814FE523944DB8EA%40SJ4PPFB81778326.namprd15.prod.outlook.com

Attachment

pgsql-hackers by date:

Previous
From: Ajit Awekar
Date:
Subject: Re: Periodic authorization expiration checks using GoAway message
Next
From: Soumya S Murali
Date:
Subject: Re: 001_password.pl fails with --without-readline