#
# Check the user provided C and CXX flags:
-# Only do this for CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as this check is very
-# costly
#
+
+IF(NOT "${CMAKE_C_FLAGS_SAVED}" STREQUAL "${DEAL_II_C_FLAGS_SAVED}")
+ UNSET(DEAL_II_HAVE_USABLE_C_FLAGS CACHE)
+ENDIF()
+SET(DEAL_II_C_FLAGS_SAVED "${CMAKE_C_FLAGS_SAVED}" CACHE INTERNAL "" FORCE)
+
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS_SAVED}")
CHECK_C_SOURCE_COMPILES(
"int main(){ return 0; }"
DEAL_II_HAVE_USABLE_C_FLAGS)
+SET(CMAKE_REQUIRED_FLAGS "")
IF(NOT DEAL_II_HAVE_USABLE_C_FLAGS)
UNSET(DEAL_II_HAVE_USABLE_C_FLAGS CACHE)
"${CMAKE_C_FLAGS_SAVED}\n"
)
ENDIF()
-UNSET(DEAL_II_HAVE_USABLE_C_FLAGS CACHE)
+
+
+IF(NOT "${CMAKE_CXX_FLAGS_SAVED}" STREQUAL "${DEAL_II_CXX_FLAGS_SAVED}")
+ UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE)
+ENDIF()
+SET(DEAL_II_CXX_FLAGS_SAVED "${CMAKE_CXX_FLAGS_SAVED}" CACHE INTERNAL "" FORCE)
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_CXX_FLAGS_SAVED}")
CHECK_CXX_SOURCE_COMPILES(
"${CMAKE_CXX_FLAGS_SAVED}\n"
)
ENDIF()
-UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE)
+
#
# CMAKE_C_COMPILER and CMAKE_CXX_COMPILER have to be of the same brand.