From db7e9ca4bdf976ca56c5e83bdabf09d0abbe98b1 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Tue, 11 Mar 2025 13:03:00 +0100 Subject: [PATCH] [#3731] Added system vs boost regex.h check --- compiler-checks/boost-regex.cc | 8 ++++++++ meson.build | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 compiler-checks/boost-regex.cc diff --git a/compiler-checks/boost-regex.cc b/compiler-checks/boost-regex.cc new file mode 100644 index 0000000000..0f7eb87b63 --- /dev/null +++ b/compiler-checks/boost-regex.cc @@ -0,0 +1,8 @@ +#include +#ifdef BOOST_RE_REGEX_H +#error "boost/regex.h" +#endif + +int main() { + return 0; +} diff --git a/meson.build b/meson.build index b06443f90f..eb1116a1ff 100644 --- a/meson.build +++ b/meson.build @@ -254,6 +254,17 @@ conf_data.set('HAVE_PGSQL', POSTGRESQL_DEP.found()) #### Compiler Checks +if cpp.has_header('boost/regex.h', dependencies: [boost_dep], required: false) + result = cpp.run( + fs.read('compiler-checks/boost-regex.cc'), + dependencies: [boost_dep], + name: 'GET_SYSTEM_VS_BOOST_REGEX_HEADER', + ) + if result.returncode() != 0 + error('boost/regex.h is used in place of system regex.h') + endif +endif + result = cpp.run( fs.read('compiler-checks/chrono-same-duration.cc'), name: 'CHRONO_SAME_DURATION',