diff options
author | Brad King <brad.king@kitware.com> | 2017-07-20 14:51:05 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-07-20 14:51:12 (GMT) |
commit | e14ad2e376ee648cd0a9daf91c6a12ee6085f6e2 (patch) | |
tree | 364208a51aeb1273245e849cf1e1568e560d4b95 /Tests | |
parent | f6a85bdbb19c4d8124f683db17c634fa48a62c02 (diff) | |
parent | 131c721f542cd6f8805967d847965510172a2c6b (diff) | |
download | CMake-e14ad2e376ee648cd0a9daf91c6a12ee6085f6e2.zip CMake-e14ad2e376ee648cd0a9daf91c6a12ee6085f6e2.tar.gz CMake-e14ad2e376ee648cd0a9daf91c6a12ee6085f6e2.tar.bz2 |
Merge topic 'vs-lang-std'
131c721f MSVC: Add flags for C++ language standards
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1063
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CompileFeatures/default_dialect.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp index 9b65b42..0de1125 100644 --- a/Tests/CompileFeatures/default_dialect.cpp +++ b/Tests/CompileFeatures/default_dialect.cpp @@ -2,25 +2,30 @@ template <long l> struct Outputter; +#if defined(_MSC_VER) && defined(_MSVC_LANG) +#define CXX_STD _MSVC_LANG +#else +#define CXX_STD __cplusplus +#endif + #if DEFAULT_CXX17 -#if __cplusplus <= 201402L -Outputter<__cplusplus> o; +#if CXX_STD <= 201402L +Outputter<CXX_STD> o; #endif #elif DEFAULT_CXX14 -#if __cplusplus != 201402L -Outputter<__cplusplus> o; +#if CXX_STD != 201402L +Outputter<CXX_STD> o; #endif #elif DEFAULT_CXX11 -#if __cplusplus != 201103L -Outputter<__cplusplus> o; +#if CXX_STD != 201103L +Outputter<CXX_STD> o; #endif #else #if !DEFAULT_CXX98 #error Buildsystem error #endif -#if __cplusplus != 199711L && __cplusplus != 1 && \ - !defined(__GXX_EXPERIMENTAL_CXX0X__) -Outputter<__cplusplus> o; +#if CXX_STD != 199711L && CXX_STD != 1 && !defined(__GXX_EXPERIMENTAL_CXX0X__) +Outputter<CXX_STD> o; #endif #endif |