]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3785] Added Boot Math vs c++14
authorFrancis Dupont <fdupont@isc.org>
Sun, 23 Mar 2025 08:57:13 +0000 (09:57 +0100)
committerFrancis Dupont <fdupont@isc.org>
Mon, 24 Mar 2025 14:54:17 +0000 (15:54 +0100)
compiler-checks/boost-math-cpp14.cc [new file with mode: 0644]
meson.build

diff --git a/compiler-checks/boost-math-cpp14.cc b/compiler-checks/boost-math-cpp14.cc
new file mode 100644 (file)
index 0000000..76d160e
--- /dev/null
@@ -0,0 +1,7 @@
+#include <boost/multiprecision/cpp_int.hpp>
+
+boost::multiprecision::checked_int128_t ci;
+
+int main() {
+    return 0;
+}
index d8a70d7ecfb1b1a9367af52dfef5e2012178223a..fdc93587ecc5687d03c888c984e4c2ad708afc6b 100644 (file)
@@ -164,6 +164,7 @@ boost_headers = [
     'boost/functional/hash.hpp',
     'boost/integer/common_factor.hpp',
     'boost/interprocess/sync/interprocess_upgradable_mutex.hpp',
+    'boost/multiprecision/cpp_int.hpp',
     'boost/shared_ptr.hpp',
     'boost/system/error_code.hpp',
 ]
@@ -314,6 +315,22 @@ if cpp_standard.version_compare('<201100')
     endif
     error('\n'.join(msgs))
 endif
+if cpp_standard.version_compare('<201400')
+    result = cpp.run(
+        fs.read('compiler-checks/boost-math-cpp14.cc'),
+        name: 'BOOST_MATH_REQUIRES_CPP14',
+        dependencies: [boost_dep, threads_dep],
+    )
+    if result.returncode() != 0
+        msgs = ['Boost Math requires at least C++14.']
+        if cpp_std_opt == 'none'
+            msgs += no_cpp_std_opt_msg
+        else
+            msgs += cpp_std_opt_msg
+        endif
+        error('\n'.join(msgs))
+    endif
+endif
 # Add Botan 3 to this.
 if NETCONF_DEP.found() and cpp_standard.version_compare('<202000')
     msgs = ['Netconf dependency requires at least C++20.']
@@ -365,17 +382,17 @@ if cpp.has_link_argument('-Wl,--no-undefined')
 endif
 
 if CRYPTO_DEP.name() == openssl.name()
-    return1 = cpp.run(
+    result1 = cpp.run(
         fs.read('compiler-checks/have-generic-tls-method.cc'),
         name: 'HAVE_GENERIC_TLS_METHOD',
         dependencies: [boost_dep, CRYPTO_DEP, threads_dep],
     )
-    return2 = cpp.run(
+    result2 = cpp.run(
         fs.read('compiler-checks/stream-truncated-error.cc'),
         name: 'HAVE_STREAM_TRUNCATED_ERROR',
         dependencies: [boost_dep, CRYPTO_DEP, threads_dep],
     )
-    if return1.returncode() != 0 or return2.returncode() != 0
+    if result1.returncode() != 0 or result2.returncode() != 0
         error('Boost TLS support broken.')
     endif
 endif