Most compilers out in the wild still don't support the flag, so we need to compare the version number anyway. This also makes it ready for whenever compilers start supporting -std=c++14, something we should fix for C++11 too. It overrides the CXX11 variable for two reasons: 1) we reuse the mechanics in c++11.prf 2) we avoid c++11.prf overriding the flag if qmake decides to process it later (CONFIG += c++14 is additive) Change-Id: I79b6523fd9017483f2474634d1c09f2fd5ea039d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
18 lines
659 B
Plaintext
18 lines
659 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
|
|
# 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
|
|
} 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
|
|
}
|
|
|
|
# Delegate to c++11.prf
|
|
include(c++11.prf)
|