ff44440651
Prefer -std=gnu++11 unless strict_c++11 is defined. You can enable strict C++11/C++14 mode by using CONFIG += strict_c++ That is enabled for Qt's own code, so we we don't accidentally use GNU extensions in portable code. There's no support for strict C++98 mode (that is, the -ansi option). [ChangeLog][qmake] By default, GNU extensions are now enabled with Clang, GCC and ICC even in C++11 and C++14 modes. To disable the GNU extensions, add to your .pro file: CONFIG += strict_c++. Change-Id: Ib056b47dde3341ef9a52ffff13ef14de2169bef5 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
24 lines
815 B
Plaintext
24 lines
815 B
Plaintext
intel_icc {
|
|
# ICC does not support C++14 yet
|
|
} else: clang {
|
|
# Clang has supported -std=c++1y since version 3.2
|
|
greaterThan(QT_CLANG_MAJOR_VERSION, 3)|greaterThan(QT_CLANG_MINOR_VERSION, 1) {
|
|
QMAKE_CXXFLAGS_CXX11 = -std=c++1y
|
|
QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++1y
|
|
}
|
|
# Unknown how long Apple Clang has supported -std=c++1y, but at least since XCode 5.0
|
|
greaterThan(QT_APPLE_CLANG_MAJOR_VERSION, 4) {
|
|
QMAKE_CXXFLAGS_CXX11 = -std=c++1y
|
|
QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++1y
|
|
}
|
|
} else: gcc {
|
|
# GCC has supported -std=c++1y since 4.8
|
|
greaterThan(QT_GCC_MAJOR_VERSION, 4)|greaterThan(QT_GCC_MINOR_VERSION, 7) {
|
|
QMAKE_CXXFLAGS_CXX11 = -std=c++1y
|
|
QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++1y
|
|
}
|
|
}
|
|
|
|
# Delegate to c++11.prf
|
|
include(c++11.prf)
|