From: Andres Notzli Date: Wed, 19 Apr 2017 15:46:59 +0000 (-0700) Subject: Add check for C++ exceptions to config script X-Git-Tag: cvc5-1.0.0~5825^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2a26e0be7238cb055f0e121df050ea1e342a2fa2;p=cvc5.git Add check for C++ exceptions to config script Bug 687 was caused by the configuration not properly supporting C++ exceptions. To avoid such an incidence in the future, this commit adds a simple check to `configure.ac` (when not cross compiling). --- diff --git a/configure.ac b/configure.ac index d2c08661b..7da86d8a8 100644 --- a/configure.ac +++ b/configure.ac @@ -253,6 +253,27 @@ AC_PROG_INSTALL CVC4_GCC_VERSION +if test $cross_compiling = "no"; then + AC_MSG_CHECKING([whether C++ exceptions work]) + AC_LANG_PUSH([C++]) + AC_RUN_IFELSE( + AC_LANG_PROGRAM([#include ], [[ + int result = 1; + try { + throw std::exception(); + } catch (...) { + result = 0; + } + return result; + ]]), + [AC_MSG_RESULT([yes])], + [AC_MSG_ERROR([C++ exceptions do not work.])] + ) + AC_LANG_POP([C++]) +else + AC_MSG_WARN([Cross compiling, cannot check whether exceptions work]) +fi + cvc4_use_gmp=2 cvc4_use_cln=2