IF(NOT "${DEAL_II_CXX_VERSION_FLAG}" STREQUAL "")
# Set CMAKE_REQUIRED_FLAGS for the unit tests
MESSAGE(STATUS "Using C++ version flag \"${DEAL_II_CXX_VERSION_FLAG}\"")
- PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
- PUSH_CMAKE_REQUIRED("-Werror")
+ ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG} -Werror")
UNSET_IF_CHANGED(CHECK_CXX_FEATURES_FLAGS_CXX17_SAVED
"${CMAKE_REQUIRED_FLAGS}${DEAL_II_CXX_VERSION_FLAG}"
)
# Set CMAKE_REQUIRED_FLAGS for the unit tests
- PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+ ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
#
# We assume std::make_unique works
#
SET(_flags "${DEAL_II_CXX_FLAGS_DEBUG}")
STRIP_FLAG(_flags "-Wa,--compress-debug-sections")
- PUSH_CMAKE_REQUIRED("${_flags}")
+ ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${_flags}")
CHECK_CXX_SOURCE_COMPILES(
"
struct foo
DEAL_II_HAVE_CXX11_MACOSXC99BUG_OK
)
-PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
CHECK_CXX_SOURCE_COMPILES(
"
// common C++11 include files
ELSE()
# see if the current compiler configuration supports the GCC extension
# __attribute__((fallthrough)) syntax instead
- PUSH_CMAKE_REQUIRED("-Werror")
- PUSH_CMAKE_REQUIRED("-Wextra")
- PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+ ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror -Wextra ${DEAL_II_CXX_VERSION_FLAG}")
CHECK_CXX_SOURCE_COMPILES(
"
int main()
ENDIF()
ENDIF()
-PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
CHECK_CXX_SOURCE_COMPILES(
"
# "warning: use of the 'deprecated' attribute is a C++14 extension" (clang in c++11 mode)
# "warning #1292: unknown attribute "deprecated"" (icc)
# Hence, we treat warnings as errors:
-PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_FLAGS}")
-PUSH_CMAKE_REQUIRED("-Werror")
-PUSH_CMAKE_REQUIRED("-Wno-unused-command-line-argument")
+ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS}")
+ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror -Wno-unused-command-line-argument")
# first see if the compiler accepts the attribute
CHECK_CXX_SOURCE_COMPILES(
#
# - Matthias Maier, 2015
#
-PUSH_CMAKE_REQUIRED("-Werror")
+ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror")
CHECK_CXX_SOURCE_COMPILES(
"
_Pragma(\"GCC diagnostic push\")
# Wolfgang Bangerth, Matthias Maier, Daniel Arndt, 2015, 2018
#
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- PUSH_CMAKE_REQUIRED("-Wno-unused-command-line-argument")
+ ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument")
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
- PUSH_CMAKE_REQUIRED("-diag-error warn")
+ ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-diag-error warn")
ENDIF()
-PUSH_CMAKE_REQUIRED("-Werror")
-PUSH_CMAKE_REQUIRED("-fuse-ld=gold")
+ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror -fuse-ld=gold")
CHECK_CXX_SOURCE_COMPILES(
"
int main() { return 0; }