From a03390a8b0318e30ae3b6dc9954093c137a20c32 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 4 Mar 2017 09:33:35 -0800 Subject: Detect the (stated) C++ standard edition at build time The configure-time detection (cxx11default) isn't enough if the compiler can be changed. This is especially necessary if Qt is compiled with a compiler that defaults to >= C++11 (e.g., GCC 6) and then the user selects a compiler another compiler (e.g., Clang) via -spec option. In that case, we'd miss adding the -std=c++11 or -std=gnu++11 option to the command-line, causing the compilation to fail. As a nice side-effect, even moc without moc_predefs.h will now get the __cplusplus setting. Task-number: QTBUG-58321 Change-Id: I74966ed02f674a7295f8fffd14a8be35da9640e1 Reviewed-by: Oswald Buddenhagen Reviewed-by: Marc Mutz --- mkspecs/features/data/macros.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'mkspecs/features/data/macros.cpp') diff --git a/mkspecs/features/data/macros.cpp b/mkspecs/features/data/macros.cpp index 88473fb980..e677dace12 100644 --- a/mkspecs/features/data/macros.cpp +++ b/mkspecs/features/data/macros.cpp @@ -1,4 +1,5 @@ // Keep this file small. The pre-processed contents are eval'd by qmake. +QT_COMPILER_STDCXX = __cplusplus #ifdef _MSC_VER QMAKE_MSC_VER = _MSC_VER QMAKE_MSC_FULL_VER = _MSC_FULL_VER -- cgit v1.2.3