]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
take over r31970
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 10 Dec 2013 13:32:53 +0000 (13:32 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 10 Dec 2013 13:32:53 +0000 (13:32 +0000)
git-svn-id: https://svn.dealii.org/branches/releases/Branch-8-1@31971 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/checks/check_03_compiler_bugs.cmake

index f278a9435d92b8d912e20a154e2be0002659fd84..f650c69ec964003363e4e693c6d609807c6fc056 100644 (file)
@@ -373,8 +373,36 @@ ENDIF()
 #
 # - Matthias Maier, 2013
 #
-
 IF( CMAKE_SYSTEM_NAME MATCHES "CYGWIN"
     OR CMAKE_SYSTEM_NAME MATCHES "Windows" )
   SET(DEAL_II_CONSTEXPR_BUG TRUE)
 ENDIF()
+
+#
+# On Mac OS-X 10.9 with recent gcc compilers in C++11 mode linking to some
+# standard C library functions, notably toupper and tolower, fail due to
+# unresolved references to this functions. Disable C++11 support in this
+# case.
+#
+# Thanks to Denis Davydov for the testcase.
+#
+# Matthias Maier, 2013
+#
+CHECK_CXX_COMPILER_BUG(
+  "
+  #include <ctype.h>
+  int main ()
+  {
+    char c = toupper('a');
+  }
+  "
+  DEAL_II_MAC_OSX_C99_BUG)
+
+IF(DEAL_II_MAC_OSX_C99_BUG)
+  MESSAGE(STATUS
+    "Mac OS-X C99 bug found, disabling C++11 support"
+    )
+  STRIP_FLAG(CMAKE_CXX_FLAGS "${DEAL_II_CXX11_FLAG}")
+  SET(DEAL_II_CAN_USE_CXX1X FALSE)
+  SET(DEAL_II_USE_CXX11 FALSE)
+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.