]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Improve error message for invalid user provided CXX and LD flags
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 26 Jan 2014 11:44:31 +0000 (11:44 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 26 Jan 2014 11:44:31 +0000 (11:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@32314 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/setup_compiler_flags.cmake

index 848f601042c6054d5df8b45c9c7662287e5f651c..d8eb42447c764bd98f3f0d76be0c11405581dbac 100644 (file)
 # Check the user provided CXX flags:
 #
 
-IF(NOT "${DEAL_II_CXX_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_CXX_FLAGS_SAVED}")
+IF( NOT "${DEAL_II_CXX_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_CXX_FLAGS_SAVED}"
+    OR NOT "${DEAL_II_LINKER_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_LINKER_FLAGS_SAVED}")
   MESSAGE(STATUS "")
   # Rerun this test if cxx flags changed:
   UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE)
 ENDIF()
 SET(CACHED_DEAL_II_CXX_FLAGS_SAVED "${DEAL_II_CXX_FLAGS_SAVED}" CACHE INTERNAL "" FORCE)
+SET(CACHED_DEAL_II_LINKER_FLAGS_SAVED "${DEAL_II_LINKER_FLAGS_SAVED}" CACHE INTERNAL "" FORCE)
 
 # Initialize all CMAKE_REQUIRED_* variables a this point:
 RESET_CMAKE_REQUIRED()
@@ -82,11 +84,12 @@ CHECK_CXX_SOURCE_COMPILES(
 
 IF(NOT DEAL_II_HAVE_USABLE_CXX_FLAGS)
   UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE)
-  MESSAGE(FATAL_ERROR "\n"
-    "Configuration error: Cannot compile with the user supplied CXX flags:\n"
-    "${DEAL_II_CXX_FLAGS_SAVED}\n"
-    "Please check the CMake variable DEAL_II_CXX_FLAGS and the\n"
-    "environment variable CXXFLAGS\n\n"
+  MESSAGE(FATAL_ERROR "
+Configuration error: Cannot compile with the user supplied flags:
+CXX flags: ${DEAL_II_CXX_FLAGS_SAVED}
+LD flags: ${DEAL_II_LINKER_FLAGS_SAVED}
+Please check the CMake variables DEAL_II_CXX_FLAGS, DEAL_II_LINKER_FLAGS
+and the environment variables CXXFLAGS, LDFLAGS.\n\n"
     )
 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.