## ---------------------------------------------------------------------
##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
##
## This file is part of the deal.II library.
##
HAVE_GLIBC_STACKTRACE)
IF(HAVE_GLIBC_STACKTRACE AND NOT DEAL_II_STATIC_EXECUTABLE)
- ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-rdynamic")
+ ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-rdynamic")
ENDIF()
#
MACRO(ENABLE_IF_SUPPORTED _variable _flag)
+ #
+ # Clang is too conservative when reporting unsupported compiler flags.
+ # Therefore, we promote all warnings for an unsupported compiler flag to
+ # actual errors with the -Werror switch:
+ #
+ IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ SET(_werror_string "-Werror ")
+ ELSE()
+ SET(_werror_string "")
+ ENDIF()
+
STRING(STRIP "${_flag}" _flag_stripped)
IF(NOT "${_flag_stripped}" STREQUAL "")
STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}")
STRING(REPLACE "-" "_" _flag_name "${_flag_name}")
STRING(REPLACE "++" "__" _flag_name "${_flag_name}")
CHECK_CXX_COMPILER_FLAG(
- "${_flag_stripped}"
+ "${_werror_string}${_flag_stripped}"
DEAL_II_HAVE_FLAG_${_flag_name}
)
IF(DEAL_II_HAVE_FLAG_${_flag_name})