]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
meson: Add headerscheck and cpluspluscheck targets
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 18 Mar 2026 10:25:47 +0000 (11:25 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 18 Mar 2026 10:27:43 +0000 (11:27 +0100)
Author: MiƂosz Bieniek <bieniek.milosz0@gmail.com>
Co-authored-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAMSWrt-PoQt4sHryWrB1ViuGBJF_PpbjoSGrWR2Ry47bHNLDqg%40mail.gmail.com

doc/src/sgml/targets-meson.txt
meson.build
src/tools/pginclude/README

index 397c103d72c0e80799c90fe9fc317d320c45dcf7..05df077cffc6c8be2c5579940006acc29fd40b8a 100644 (file)
@@ -17,6 +17,8 @@ Developer Targets:
   reformat-dat-files            Rewrite catalog data files into standard format
   expand-dat-files              Expand all data files to include defaults
   update-unicode                Update Unicode data to new version
+  headerscheck                  Check that all headers compile standalone
+  cpluspluscheck                Check that all headers compile as C++
 
 Documentation Targets:
   html                          Build documentation in multi-page HTML format
index 43894f050e8998fbe556104372af3dcdd27e6074..7ee900198db80390a1b9d329f0e4307b07cc1690 100644 (file)
@@ -4022,6 +4022,21 @@ add_test_setup('running',
 
 
 
+###############################################################
+# headerscheck
+###############################################################
+
+headerscheck = files('src/tools/pginclude/headerscheck')
+run_target('headerscheck',
+  command: [headerscheck, meson.project_source_root(), meson.project_build_root()]
+)
+
+run_target('cpluspluscheck',
+  command: [headerscheck, '--cplusplus', meson.project_source_root(), meson.project_build_root()]
+)
+
+
+
 ###############################################################
 # Pseudo targets
 ###############################################################
index 944bcb01c64dcf29e35bb63b6eef65e910333b21..f7f5ff2c01b2e60357cd0b1a413bd7af6318c906 100644 (file)
@@ -62,6 +62,9 @@ have included at least
 in your configure options, else you're likely to get errors about
 related headers not being found.
 
+When using meson, run "meson compile -C build headerscheck" or "ninja
+-C build headerscheck".
+
 A limitation of the current script is that it doesn't know exactly which
 headers are for frontend or backend; when in doubt it uses postgres.h as
 prerequisite, even if postgres_fe.h or c.h would be more appropriate.
@@ -89,6 +92,9 @@ have included at least
 in your configure options, else you're likely to get errors about
 related headers not being found.
 
+When using meson, run "meson compile -C build cpluspluscheck" or
+"ninja -C build cpluspluscheck".
+
 If you are using a non-g++-compatible C++ compiler, you may need to
 override the script's CXXFLAGS setting by setting a suitable environment
 value.