]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Always add the user version flag. 4129/head
authorDavid Wells <wellsd2@rpi.edu>
Tue, 28 Mar 2017 16:16:18 +0000 (12:16 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Tue, 28 Mar 2017 16:16:18 +0000 (12:16 -0400)
This gets around a bug where, if a user requests '-std=c++03' and is using a
compiler which defaults to C++11 or newer (e.g., GCC 6) then the library is
compiled with the default language flag (e.g., gnu++14) but
DEAL_II_WITH_CXX11=OFF: this causes compilation errors with boost::optional.

cmake/checks/check_01_cxx_features.cmake

index ac17aaad078a8e75df7d886ae8f221b0ff82bbe8..8c3e490f809321f85f45ba59c8c98433c106b39b 100644 (file)
@@ -406,6 +406,13 @@ IF (DEAL_II_WITH_CXX14)
 ELSEIF(DEAL_II_WITH_CXX11)
   ADD_FLAGS(DEAL_II_CXX_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
   MESSAGE(STATUS "DEAL_II_WITH_CXX11 successfully set up")
+  #
+  # If the user specified a flag that does not imply C++11 or C++14 (e.g.,
+  # -std=c++03) then add it
+  #
+ELSEIF(_user_provided_cxx_version_flag)
+  MESSAGE(STATUS "Using C++ version flag \"${DEAL_II_CXX_VERSION_FLAG}\"")
+  ADD_FLAGS(DEAL_II_CXX_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
 ELSE()
   MESSAGE(STATUS "DEAL_II_WITH_CXX14 and DEAL_II_WITH_CXX11 are both disabled")
 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.