diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-06-18 14:23:21 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2014-07-20 04:32:44 +0200 |
commit | 40d3ab564b02ed72d43ae1d29c638556003d5e17 (patch) | |
tree | fda67e51b63a7e2936bb1720f9f8f886fe7eb094 /mkspecs | |
parent | 4a99beb7efa7b28916e30be675f4923378c982ab (diff) |
Add support for CONFIG += c++14
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>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/c++14.prf | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mkspecs/features/c++14.prf b/mkspecs/features/c++14.prf new file mode 100644 index 0000000000..a54d11840d --- /dev/null +++ b/mkspecs/features/c++14.prf @@ -0,0 +1,17 @@ +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) |