]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix c++11 detection under MSVC 4258/head
authorTimo Heister <timo.heister@gmail.com>
Fri, 14 Apr 2017 12:58:57 +0000 (08:58 -0400)
committerTimo Heister <timo.heister@gmail.com>
Fri, 14 Apr 2017 17:53:02 +0000 (13:53 -0400)
It turns out MSVC defines __cplusplus as 1997 even with MSVC 2017. Sigh.
Instead of trying to parse what support we have, just skip this macro
check and hope we catch all problems with the configuration tests
itself.

cmake/checks/check_01_cxx_features.cmake

index fa7b3d31c4bcb82d757bf6f480e0fb9a79362c31..58b8efde462f1e2fe641012e9564905fbbadfe2b 100644 (file)
@@ -177,8 +177,9 @@ CHECK_CXX_SOURCE_COMPILES(
   thread_local std::array<int,3> p;
   std::condition_variable c;
 
-  // check the version language macro
-  #if !(__cplusplus >= 201103L)
+  // Check the version language macro, but skip MSVC because
+  // MSVC reports 199711 even in MSVC 2017.
+  #if __cplusplus < 201103L && !defined(_MSC_VER)
   #  error \"insufficient support for C++11\"
   #endif
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.