Autotools: Improve handling of C++ mode

This commit is contained in:
sledgehammer999 2018-11-24 00:12:38 +02:00
commit 847ecdeedb
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
3 changed files with 124 additions and 82 deletions

View file

@ -36,3 +36,16 @@ AC_DEFUN([FIND_QTDBUS],
[AC_MSG_RESULT([not found])
HAVE_QTDBUS=[false]])
])
# DETECT_CPP11_PROGRAM()
# Detects if at least C++11 mode is enabled.
# --------------------------------------
AC_DEFUN([DETECT_CPP11_PROGRAM],
[AC_LANG_PROGRAM([[
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#endif]],
[[]])
])