]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3731] Added system vs boost regex.h check
authorFrancis Dupont <fdupont@isc.org>
Tue, 11 Mar 2025 12:03:00 +0000 (13:03 +0100)
committerFrancis Dupont <fdupont@isc.org>
Thu, 13 Mar 2025 17:03:37 +0000 (18:03 +0100)
compiler-checks/boost-regex.cc [new file with mode: 0644]
meson.build

diff --git a/compiler-checks/boost-regex.cc b/compiler-checks/boost-regex.cc
new file mode 100644 (file)
index 0000000..0f7eb87
--- /dev/null
@@ -0,0 +1,8 @@
+#include <regex.h>
+#ifdef BOOST_RE_REGEX_H
+#error "boost/regex.h"
+#endif
+
+int main() {
+    return 0;
+}
index b06443f90fd713a5e9fe1bd1ab1dbc0d063572e4..eb1116a1ffb59bf2a260d0a39e823b529a48dfc5 100644 (file)
@@ -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',