lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 8121f6d: Do give an error in configure if C++


From: Vadim Zeitlin
Subject: [lmi-commits] [lmi] master 8121f6d: Do give an error in configure if C++17 can't be used
Date: Tue, 2 Jun 2020 12:50:13 -0400 (EDT)

branch: master
commit 8121f6d6e158db7511ae406a90eaf2a52d365848
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Vadim Zeitlin <vadim@tt-solutions.com>

    Do give an error in configure if C++17 can't be used
    
    This improves the behaviour when the current compiler doesn't compile in
    C++17 mode by default after the changes of 94eec1396 (Stop imposing the
    use of C++17 in configure, 2020-05-10) and stops the build immediately
    in this case instead of failing (much) later with a compilation error
    when a C++17 construct is encountered in the code.
---
 configure.ac | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index b9835e0..f07505e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,7 +132,7 @@ static_assert(true);
 #endif
 ]])
 
-AC_CACHE_CHECK([whether compiler supports C++17],
+AC_CACHE_CHECK([whether compiler supports C++17 without any options],
     lmi_cv_cxx_std17,
     [
         AC_LANG_PUSH([C++])
@@ -144,6 +144,12 @@ AC_CACHE_CHECK([whether compiler supports C++17],
     ]
 )
 
+if test "$lmi_cv_cxx_std17" = "no"; then
+    AX_CXX_CHECK_FLAG([-std=c++17],,,[CXXFLAGS="$CXXFLAGS -std=c++17"],
+        AC_MSG_ERROR([Can't enable C++17 support required for building lmi.])
+    )
+fi
+
 AC_PROG_LD
 
 # This is a workaround for the harmless but annoying warning



reply via email to

[Prev in Thread] Current Thread [Next in Thread]