postgresql/contrib/sepgsql
Andres Freund e5555657ba meson: Add support for building with precompiled headers
This substantially speeds up building for windows, due to the vast amount of
headers included via windows.h. A cross build from linux targetting mingw goes
from

994.11user 136.43system 0:31.58elapsed 3579%CPU
to
422.41user 89.05system 0:14.35elapsed 3562%CPU

The wins on windows are similar-ish (but I don't have a system at hand just
now for actual numbers). Targetting other operating systems the wins are far
smaller (tested linux, macOS, FreeBSD).

For now precompiled headers are disabled by default, it's not clear how well
they work on all platforms. E.g. on FreeBSD gcc doesn't seem to have working
support, but clang does.

When doing a full build precompiled headers are only beneficial for targets
with multiple .c files, as meson builds a separate precompiled header for each
target (so that different compilation options take effect). This commit
therefore only changes target with at least two .c files to use precompiled
headers.

Because this commit adds b_pch=false to the default_options new build
directories will have precompiled headers disabled by default, however
existing build directories will continue use the default value of b_pch, which
is true.

Note that using precompiled headers with ccache requires setting
CCACHE_SLOPPINESS=pch_defines,time_macros to get hits.

Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Reviewed-by: Justin Pryzby <pryzby@telsasoft.com>
Discussion: https://postgr.es/m/CA+hUKG+50eOUbN++ocDc0Qnp9Pvmou23DSXu=ZA6fepOcftKqA@mail.gmail.com
Discussion: https://postgr.es/m/c5736f70-bb6d-8d25-e35c-e3d886e4e905@enterprisedb.com
Discussion: https://postgr.es/m/20190826054000.GE7005%40paquier.xyz
2022-10-06 17:19:30 -07:00
..
expected Include permissive/enforcing state in sepgsql log messages. 2022-01-12 14:23:13 -05:00
sql Remove gratuitous uses of deprecated SELECT INTO 2021-01-28 14:28:41 +01:00
.gitignore Minor sepgsql regression test fixes. 2011-02-02 23:46:51 -05:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
database.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
dml.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
hooks.c Remove now superfluous declarations of dlsym()ed symbols. 2022-07-17 17:29:32 -07:00
label.c Avoid casting away const in sepgsql's quote_object_name. 2022-08-27 12:52:39 -04:00
launcher Update copyright for 2022 2022-01-07 19:04:57 -05:00
meson.build meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
proc.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
relation.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
schema.c Fix an assortment of improper usages of string functions 2022-09-06 13:19:44 +12:00
selinux.c Remove unused code from sepgsql 2022-09-02 20:38:34 +02:00
sepgsql-regtest.te Update sepgsql to add mandatory access control for TRUNCATE 2019-11-23 10:46:44 -05:00
sepgsql.h Remove unused code from sepgsql 2022-09-02 20:38:34 +02:00
sepgsql.sql.in sepgsql_setcon(). 2012-03-15 16:08:40 -04:00
test_sepgsql Update sepgsql to add mandatory access control for TRUNCATE 2019-11-23 10:46:44 -05:00
uavc.c Include permissive/enforcing state in sepgsql log messages. 2022-01-12 14:23:13 -05:00